X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fexpressions%2Foperations.def;fp=src%2Flanguage%2Fexpressions%2Foperations.def;h=6f0bd0e1430a3f4bcbf1a0742fef8303bb6918ab;hb=35dac0a274893c6ba1d58d33a0889096eef033b4;hp=03861021c4f4863ebcf5976710c8e893a53ebfe9;hpb=613c43f8bc580c48a5a4d8078b83360e29483b38;p=pspp-builds.git diff --git a/src/language/expressions/operations.def b/src/language/expressions/operations.def index 03861021..6f0bd0e1 100644 --- a/src/language/expressions/operations.def +++ b/src/language/expressions/operations.def @@ -318,6 +318,12 @@ function XDATE.WEEK (date >= DAY_S) function XDATE.WKDAY (date >= DAY_S) = calendar_offset_to_wday (date / DAY_S); function XDATE.YEAR (date >= DAY_S) = calendar_offset_to_year (date / DAY_S); +// Date arithmetic functions. +function DATEDIFF (date1, date2, string unit) = unimplemented; +function DATESUM (date, quantity, string unit) = unimplemented; +function DATESUM (date, quantity, string unit, string roll_over) + = unimplemented; + // String functions. string function CONCAT (string a[n]) expression e; @@ -607,6 +613,17 @@ absorb_miss string function SUBSTR (string s, ofs, cnt) return empty_string; } +absorb_miss no_opt string function VALUELABEL (var v) + expression e; + case c; +{ + const char *label = var_lookup_value_label (v, case_data (c, v)); + if (label != NULL) + return copy_string (e, label, strlen (label)); + else + return empty_string; +} + // Artificial. operator SQUARE (x) = x * x; boolean operator NUM_TO_BOOLEAN (x)