improve functino parsing
[pspp] / tests / language / control / define.at
index 1e18b81bd716e89cdfc5bfb0625bdaab488ca4ea..aa1998d82e878678a49e617575242f43cef51295 100644 (file)
@@ -1254,45 +1254,129 @@ AT_SETUP([generic macro function syntax errors])
 AT_DATA([define.sps], [dnl
 DEFINE !a() !SUBSTR !ENDDEFINE.
 DEFINE !b() !SUBSTR x !ENDDEFINE.
-DEFINE !c() !SUBSTR(1,2,3,4) !ENDDEFINE.
-DEFINE !d() !SUBSTR(1x) !ENDDEFINE.
-DEFINE !e() !SUBSTR(1 !ENDDEFINE.
+DEFINE !c() !SUBSTR(1x) !ENDDEFINE.
+DEFINE !d() !SUBSTR(1 !ENDDEFINE.
+DEFINE !narg_blanks() !BLANKS() !ENDDEFINE.
+DEFINE !narg_concat() !CONCAT() !ENDDEFINE.
+DEFINE !narg_eval() !EVAL() !ENDDEFINE.
+DEFINE !narg_head() !HEAD() !ENDDEFINE.
+DEFINE !narg_index() !INDEX() !ENDDEFINE.
+DEFINE !narg_length() !LENGTH() !ENDDEFINE.
+DEFINE !narg_null() !NULL() !ENDDEFINE.
+DEFINE !narg_quote() !QUOTE() !ENDDEFINE.
+DEFINE !narg_substr() !SUBSTR() !ENDDEFINE.
+DEFINE !narg_tail() !TAIL() !ENDDEFINE.
+DEFINE !narg_unquote() !UNQUOTE() !ENDDEFINE.
+DEFINE !narg_upcase() !UPCASE() !ENDDEFINE.
 dnl )
 DEBUG EXPAND.
 !a.
 !b.
 !c.
 !d.
-!e.
+!narg_blanks.
+!narg_concat.
+!narg_eval.
+!narg_head.
+!narg_index.
+!narg_length.
+!narg_null.
+!narg_quote.
+!narg_substr.
+!narg_tail.
+!narg_unquote.
+!narg_upcase.
 ])
 AT_CHECK([pspp --testing-mode define.sps], [1], [dnl
 define.sps:1: In the expansion of `!a',
-define.sps:7: error: DEBUG EXPAND: `(' expected following !SUBSTR.
+define.sps:18: error: DEBUG EXPAND: `@{:@' expected following !SUBSTR.
 
 !SUBSTR
 
 define.sps:2: At `x' in the expansion of `!b',
-define.sps:8: error: DEBUG EXPAND: `(' expected following !SUBSTR.
+define.sps:19: error: DEBUG EXPAND: `@{:@' expected following !SUBSTR.
 
 !SUBSTR x
 
-define.sps:3: At `)' in the expansion of `!c',
-define.sps:9: error: DEBUG EXPAND: Wrong number of arguments to macro
-function !SUBSTR.
-
-!SUBSTR(1, 2, 3, 4)
-
-define.sps:4: At `x' in the expansion of `!d',
-define.sps:10: error: DEBUG EXPAND: `,' or `)' expected in call to macro
+define.sps:3: At `x' in the expansion of `!c',
+define.sps:20: error: DEBUG EXPAND: `,' or `@:}@' expected in call to macro
 function !SUBSTR.
 
 !SUBSTR(1 x)
 
-define.sps:5: In the expansion of `!e',
-define.sps:11: error: DEBUG EXPAND: Missing `)' in call to macro function !
+define.sps:4: In the expansion of `!d',
+define.sps:21: error: DEBUG EXPAND: Missing `@:}@' in call to macro function !
 SUBSTR.
 
-!SUBSTR(1
+!SUBSTR@{:@1
+
+define.sps:5: In the expansion of `!narg_blanks',
+define.sps:22: error: DEBUG EXPAND: Macro function !BLANKS takes one argument
+(not 0).
+
+!BLANKS( )
+
+define.sps:6: In the expansion of `!narg_concat',
+define.sps:23: error: DEBUG EXPAND: Macro function !CONCAT needs at least one
+argument.
+
+!CONCAT( )
+
+define.sps:7: In the expansion of `!narg_eval',
+define.sps:24: error: DEBUG EXPAND: Macro function !EVAL takes one argument
+(not 0).
+
+!EVAL( )
+
+define.sps:8: In the expansion of `!narg_head',
+define.sps:25: error: DEBUG EXPAND: Macro function !HEAD takes one argument
+(not 0).
+
+!HEAD( )
+
+define.sps:9: In the expansion of `!narg_index',
+define.sps:26: error: DEBUG EXPAND: Macro function !INDEX takes two arguments
+(not 0).
+
+!INDEX( )
+
+define.sps:10: In the expansion of `!narg_length',
+define.sps:27: error: DEBUG EXPAND: Macro function !LENGTH takes one argument
+(not 0).
+
+!LENGTH( )
+
+( )
+
+define.sps:12: In the expansion of `!narg_quote',
+define.sps:29: error: DEBUG EXPAND: Macro function !QUOTE takes one argument
+(not 0).
+
+!QUOTE( )
+
+define.sps:13: In the expansion of `!narg_substr',
+define.sps:30: error: DEBUG EXPAND: Macro function !SUBSTR takes two or three
+arguments (not 0).
+
+!SUBSTR( )
+
+define.sps:14: In the expansion of `!narg_tail',
+define.sps:31: error: DEBUG EXPAND: Macro function !TAIL takes one argument
+(not 0).
+
+!TAIL( )
+
+define.sps:15: In the expansion of `!narg_unquote',
+define.sps:32: error: DEBUG EXPAND: Macro function !UNQUOTE takes one argument
+(not 0).
+
+!UNQUOTE( )
+
+define.sps:16: In the expansion of `!narg_upcase',
+define.sps:33: error: DEBUG EXPAND: Macro function !UPCASE takes one argument
+(not 0).
+
+!UPCASE( )
 ])
 AT_CLEANUP