flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > [?bug] fasmg: difference in namespace symbol definitions |
Author |
|
Tomasz Grysztar 14 Aug 2023, 07:20
As it is currently specified by documentation, you can prepend "?" to a whole identifier, not to a name inside the identifier. Therefore the one inside of an identifier is not expected to be followed by a name and as such it is an incorrect syntax that causes the identifier parsing to be aborted. This in turn results in a side-effect of splitting the DEFINE on unexpected boundaries. The DEFINE syntax is quirky (compared to EQU, for example) - it's inherited from fasm 1, but does not play well with fasmg's engine. I could perhaps change it to require whitespace between the identifier and the value - even though it would differ from fasm 1, it would certainly be more intuitive.
|
|||
14 Aug 2023, 07:20 |
|
bitRAKE 14 Aug 2023, 09:06
Thank you, that makes sense. EQU does produce the error, and it's documented behavior. I do remember "?" not being allowed in the middle. So, the corner case is just in the DEFINE quirkiness not producing the error that EQU does.
One potential example would be an implementation of the concept Jin X presented - kind of an auto epilog. It could be given a snazzy syntax, and reading the code later - I think the question mark would slow me down - that and the missing label. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
14 Aug 2023, 09:06 |
|
Tomasz Grysztar 14 Aug 2023, 16:41
On a side note - you could also use the new "late interceptor" to only catch the lines that have no valid instruction, to retry after TRANSFORMing them:
Code: calminstruction ?? line& transform line assemble line end calminstruction macro test display 'macro',10 end macro define test display 'equ',10 test ?test |
|||
14 Aug 2023, 16:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.