Fix some typos (found by codespell)
[pspp] / src / language / stats / rank.c
index dd3bea12832cf11887e28983932369454c0a838b..65a0fb8b574a9fb66b75031ed65332c7514e0ceb 100644 (file)
@@ -162,7 +162,7 @@ try_new_name (const char *new_name,
 }
 
 /* Returns a variable name for storing ranks of a variable named SRC_NAME
-   accoring to the rank function F.  The name chosen will not be one already in
+   according to the rank function F.  The name chosen will not be one already in
    DICT or NEW_NAMES.
 
    If successful, adds the new name to NEW_NAMES and returns the name added.
@@ -257,7 +257,7 @@ parse_into (struct lexer *lexer, struct rank *cmd,
 
   cmd->rs = pool_realloc (cmd->pool, cmd->rs, sizeof (*cmd->rs) * (cmd->n_rs + 1));
   rs = &cmd->rs[cmd->n_rs];
-      
+
   if (lex_match_id (lexer, "RANK"))
     {
       rs->rfunc = RANK;
@@ -290,13 +290,13 @@ parse_into (struct lexer *lexer, struct rank *cmd,
     {
       if ( !lex_force_match (lexer, T_LPAREN))
        return false;
-      
+
       if (! lex_force_int (lexer) )
        return false;
-      
+
       cmd->k_ntiles = lex_integer (lexer);
       lex_get (lexer);
-      
+
       if ( !lex_force_match (lexer, T_RPAREN))
        return false;
 
@@ -638,7 +638,7 @@ create_var_label (struct rank *cmd, const struct variable *src_var,
                    function_name[f], var_get_name (src_var));
 
   pool_label = pool_strdup (cmd->pool, ds_cstr (&label));
-  
+
   ds_destroy (&label);
 
   return pool_label;
@@ -668,7 +668,8 @@ cmd_rank (struct lexer *lexer, struct dataset *ds)
   string_set_init (&new_names);
 
   if (lex_match_id (lexer, "VARIABLES"))
-    lex_force_match (lexer, T_EQUALS);
+    if (! lex_force_match (lexer, T_EQUALS))
+      goto error;
 
   if (!parse_sort_criteria (lexer, rank.dict,
                            &rank.sc,
@@ -688,10 +689,12 @@ cmd_rank (struct lexer *lexer, struct dataset *ds)
 
   while (lex_token (lexer) != T_ENDCMD )
     {
-      lex_force_match (lexer, T_SLASH);
+      if (! lex_force_match (lexer, T_SLASH))
+       goto error;
       if (lex_match_id (lexer, "TIES"))
        {
-         lex_force_match (lexer, T_EQUALS);
+         if (! lex_force_match (lexer, T_EQUALS))
+           goto error;
          if (lex_match_id (lexer, "MEAN"))
            {
              rank.ties = TIES_MEAN;
@@ -716,7 +719,8 @@ cmd_rank (struct lexer *lexer, struct dataset *ds)
        }
       else if (lex_match_id (lexer, "FRACTION"))
        {
-         lex_force_match (lexer, T_EQUALS);
+         if (! lex_force_match (lexer, T_EQUALS))
+           goto error;
          if (lex_match_id (lexer, "BLOM"))
            {
              rank.fraction = FRAC_BLOM;
@@ -741,7 +745,8 @@ cmd_rank (struct lexer *lexer, struct dataset *ds)
        }
       else if (lex_match_id (lexer, "PRINT"))
        {
-         lex_force_match (lexer, T_EQUALS);
+         if (! lex_force_match (lexer, T_EQUALS))
+           goto error;
          if (lex_match_id (lexer, "YES"))
            {
              rank.print = true;
@@ -758,7 +763,8 @@ cmd_rank (struct lexer *lexer, struct dataset *ds)
        }
       else if (lex_match_id (lexer, "MISSING"))
        {
-         lex_force_match (lexer, T_EQUALS);
+         if (! lex_force_match (lexer, T_EQUALS))
+           goto error;
          if (lex_match_id (lexer, "INCLUDE"))
            {
              rank.exclude = MV_SYSTEM;