mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
cbf768d67d
Implement %iftoken, a test for a single token. This is useful in cases using %+ to splice a macro-provided token.
109 lines
1.4 KiB
NASM
109 lines
1.4 KiB
NASM
db 'N "1": '
|
|
%iftoken 1
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "1": '
|
|
%iftoken 1 ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "+1": '
|
|
%iftoken +1
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "+1": '
|
|
%iftoken +1 ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "1 2": '
|
|
%iftoken 1 2
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "1 2": '
|
|
%iftoken 1 2 ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "1,2": '
|
|
%iftoken 1,2
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "1,2": '
|
|
%iftoken 1,2 ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "foo": '
|
|
%iftoken foo
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "foo": '
|
|
%iftoken foo ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "foo bar": '
|
|
%iftoken foo bar
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "foo bar": '
|
|
%iftoken foo bar ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "%": '
|
|
%iftoken %
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "%": '
|
|
%iftoken % ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "+foo": '
|
|
%iftoken +foo
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "+foo": '
|
|
%iftoken +foo ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'N "<<": '
|
|
%iftoken <<
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|
|
db 'C "<<": '
|
|
%iftoken << ; With a comment!
|
|
db 'Yes', 10
|
|
%else
|
|
db 'No', 10
|
|
%endif
|