diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-02-16 16:41:25 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-02-16 16:41:25 -0800 |
commit | cbf768d67d5540681df5e6ea41fe1fb270c95eec (patch) | |
tree | 62d5f522c11af3e848bfd4dd8930d441dd8c3633 /test/iftoken.pl | |
parent | 88ab419cc6f190e52052942943fae7779a22c0e1 (diff) | |
download | nasm-cbf768d67d5540681df5e6ea41fe1fb270c95eec.tar.gz nasm-cbf768d67d5540681df5e6ea41fe1fb270c95eec.tar.bz2 nasm-cbf768d67d5540681df5e6ea41fe1fb270c95eec.zip |
Implement %iftoken, test for a single token
Implement %iftoken, a test for a single token. This is useful in
cases using %+ to splice a macro-provided token.
Diffstat (limited to 'test/iftoken.pl')
-rwxr-xr-x | test/iftoken.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/iftoken.pl b/test/iftoken.pl new file mode 100755 index 0000000..bbbb5bc --- /dev/null +++ b/test/iftoken.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +@list = ('1', '+1', '1 2', '1,2', 'foo', 'foo bar', '%', '+foo', '<<'); + +foreach $t (@list) { + print "\tdb 'N \"$t\": '\n"; + print "%iftoken $t\n"; + print "\tdb 'Yes', 10\n"; + print "%else\n"; + print "\tdb 'No', 10\n"; + print "%endif\n"; + + print "\tdb 'C \"$t\": '\n"; + print "%iftoken $t ; With a comment!\n"; + print "\tdb 'Yes', 10\n"; + print "%else\n"; + print "\tdb 'No', 10\n"; + print "%endif\n"; +} |