Implemented support for very long strings a la spss v13/v14
[pspp-builds.git] / src / language / expressions / parse.c
index e063acb5cae2995009a70dfef36ca5929b00f50c..fdd460824e6b5c9d0435c38d9a97665c8bc7c7b7 100644 (file)
@@ -731,11 +731,11 @@ parse_sysvar (struct expression *e)
           "JUL", "AUG", "SEP", "OCT", "NOV", "DEC",
         };
 
-      time_t last_vfm_invocation = vfm_last_invocation ();
+      time_t last_proc_time = time_of_last_procedure ();
       struct tm *time;
       char temp_buf[10];
 
-      time = localtime (&last_vfm_invocation);
+      time = localtime (&last_proc_time);
       sprintf (temp_buf, "%02d %s %02d", abs (time->tm_mday) % 100,
                months[abs (time->tm_mon) % 12], abs (time->tm_year) % 100);
 
@@ -749,7 +749,7 @@ parse_sysvar (struct expression *e)
     return expr_allocate_number (e, SYSMIS);
   else if (lex_match_id ("$JDATE"))
     {
-      time_t time = vfm_last_invocation ();
+      time_t time = time_of_last_procedure ();
       struct tm *tm = localtime (&time);
       return expr_allocate_number (e, expr_ymd_to_ofs (tm->tm_year + 1900,
                                                        tm->tm_mon + 1,
@@ -757,7 +757,7 @@ parse_sysvar (struct expression *e)
     }
   else if (lex_match_id ("$TIME"))
     {
-      time_t time = vfm_last_invocation ();
+      time_t time = time_of_last_procedure ();
       struct tm *tm = localtime (&time);
       return expr_allocate_number (e,
                                    expr_ymd_to_date (tm->tm_year + 1900,
@@ -1222,6 +1222,11 @@ parse_function (struct expression *e)
       msg (SE, _("%s is not yet implemented."), f->prototype);
       goto fail;
     }
+  if ((f->flags & OPF_PERM_ONLY) && temporary != 0) 
+    {
+      msg (SE, _("%s may not appear after TEMPORARY."), f->prototype);
+      goto fail;
+    }
   
   n = expr_allocate_composite (e, f - operations, args, arg_cnt);
   n->composite.min_valid = min_valid != -1 ? min_valid : f->array_min_elems; 
@@ -1417,8 +1422,8 @@ expr_allocate_string_buffer (struct expression *e,
 {
   union any_node *n = pool_alloc (e->expr_pool, sizeof n->string);
   n->type = OP_string;
-  if (length > 255)
-    length = 255;
+  if (length > MAX_STRING)
+    length = MAX_STRING;
   n->string.s = copy_string (e, string, length);
   return n;
 }