FUNNELWEB LISTING FILE ====================== Global Local| Input File ------------+------------------------------------------------------------------- 1 1| AN03: Test semantics checking of macros. 2 2| 3 3| First define some macros to call. 4 4| @$@@Z@M@{@} 5 5| @$@@(@1@)@Z@M@{@} 6 6| @$@@(@2@)@Z@M@{@} 7 7| 8 8| 1. Test call to undefined macro. 9 9| @$@@Z==@{@@} Error|...................^Call to undefined macro. 10 10| 11 11| 2. Test calls with wrong number of parameters. 12 12| @$@@Z==@{ 13 13| @ 14 14| @@(@) Error|.^Call has 1 parameter, but the macro |.^definition at line 4 specifies 0 parameters. |.^Note: If your call looks like this: @@(@) then you |.^should be aware that FunnelWeb treats this as a call with |.^a single parameter consisting of the empty string. This |.^is a consequence of parameter delimiters @"@" being optional. 15 15| @@(@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 4 specifies 0 parameters. 16 16| @ Error|.^Call has 0 parameters, but the macro |.^definition at line 5 specifies 1 parameter. 17 17| @@(@) 18 18| @@(Walrus@,@) Error|.^Call has 2 parameters, but the macro |.^definition at line 5 specifies 1 parameter. 19 19| @@(Sloth@) Error|.^Call has 1 parameter, but the macro |.^definition at line 6 specifies 2 parameters. 20 20| @} 21 21| 22 22| 3. Test call to file macro. 23 23| @O@@{@} |.^This file macro is called one or more times. |.^Each call has been flagged with an error message. 24 24| @$@@Z@{@@} Error|.................^Calls to file macros are not allowed. |.................^Reason: It should be possible to comment out a |.................^file macro without a big fuss. Calling a file macro |.................^just tangles it up in the macro structure, |.................^making it more difficult to comment out later. 25 25| 26 26| 4. Test macro never used and has Z. 27 27| @$@@Z@{@} 28 28| 29 29| 5. Test macro often used and has M. 30 30| @$@@M@{@} 31 31| @$@@Z@{@@@} 32 32| 33 33| 6. Test macro never used and no Z 34 34| @$@@{@} Error|.^This macro is never used (and has no @Z). 35 35| 36 36| 7. Test multiply used and no M. 37 37| @$@@{@} Error|.^This macro is used more than once (and has no @M). 38 38| @$@@Z@{@@@} 39 39| 40 40| 8. Test directly recursive macro. 41 41| @$@@{@@} Error|.^This macro has an infinite expansion. 42 42| 43 43| 9. Test indirectly recursive macro. 44 44| @$@@M@{@@} Error|.^This macro has an infinite expansion. 45 45| @$@@{@@} Error|.^This macro has an infinite expansion. 46 46| 47 47| 10. Test callers of recursive macros. 48 48| @$@@Z@{@@} Error|.^This macro has an infinite expansion. | ------------+------------------------------------------------------------------- There were 13 Errors.