added minmax
[pspp-builds.git] / src / language / expressions / parse.c
index 07a56f8ef675ef5f7c3f7bdd0cbcc92949a535b9..695d3caf6d5b7a13880aa8c9d05447d1586a4ab7 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -1217,7 +1216,8 @@ parse_function (struct lexer *lexer, struct expression *e)
   if (lex_token (lexer) != ')')
     for (;;)
       {
-        if (lex_token (lexer) == T_ID && lex_look_ahead (lexer) == 'T')
+        if (lex_token (lexer) == T_ID
+            && toupper (lex_look_ahead (lexer)) == 'T')
           {
             struct variable **vars;
             size_t var_cnt;
@@ -1279,18 +1279,14 @@ parse_function (struct lexer *lexer, struct expression *e)
   n->composite.min_valid = min_valid != -1 ? min_valid : f->array_min_elems; 
 
   if (n->type == OP_LAG_Vn || n->type == OP_LAG_Vs) 
-    {
-      if (dataset_n_lag (e->ds) < 1)
-        dataset_set_n_lag (e->ds, 1);
-    }
+    dataset_need_lag (e->ds, 1);
   else if (n->type == OP_LAG_Vnn || n->type == OP_LAG_Vsn)
     {
       int n_before;
       assert (n->composite.arg_cnt == 2);
       assert (n->composite.args[1]->type == OP_pos_int);
       n_before = n->composite.args[1]->integer.i;
-      if ( dataset_n_lag (e->ds) < n_before)
-        dataset_set_n_lag (e->ds, n_before);
+      dataset_need_lag (e->ds, n_before);
     }
   
   free (args);