flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > [BUG?]Are numbers valid symbols? |
Author |
|
LocoDelAssembly 24 Apr 2011, 00:09
Check this out:
Code: ; OK 1 equ 'one', 13, 10 display 1 ; OK macro 2{ display 'two', 13, 10 } 2 ; INVALID NAME ;macro '3'{ ; display 'three', 13, 10 ;} ;'3' ;'4' equ 'four', 13, 10 ; ILLEGAL INSTRUCTION display '4', 13, 10 5.0 equ 'five', 13, 10 display 5.0 macro 6.0{ display 'six', 13, 10 } 6.0 This was discovered by ouadji when he tested numerical names on PROC arguments. |
|||
24 Apr 2011, 00:09 |
|
revolution 24 Apr 2011, 01:12
Preprocessor is not sensitive to symbol contents. They are all just strings of characters to be processed as usual.
|
|||
24 Apr 2011, 01:12 |
|
revolution 25 Apr 2011, 01:51
rept has special processing to evaluate values so it won't see the 'equ' substitutions for plain numbers.
Code: display 13, 10 match x,1 {rept x{display 'one, '\}} |
|||
25 Apr 2011, 01:51 |
|
Tomasz Grysztar 26 Apr 2011, 18:15
Right, this was not an issue before the new REPT functionality was introduced, however now it is worth a reconsideration. Would disallowing a digit-starting names for symbolic variables cause any problems. I do not think anyone would use this feature for any serious purpose, but I may be wrong.
|
|||
26 Apr 2011, 18:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.