flat assembler
Message board for the users of flat assembler.
Index
> Programming Language Design > fasmg preprocessing options |
Author |
|
bitRAKE 14 Feb 2019, 21:05
What kind of complications might one encounter when trying to wrap lines in ISOLATELINES / COMBINELINES or RETAINCOMMENTS / REMOVECOMMENTS? For example, it wouldn't be sufficient to wrap the above macro - as the preprocessing of following lines would strip comments obviously. It seems a great deal of care is needed in a larger context to get the desired result.
Nonetheless a very powerful feature. I've experimented with here: https://board.flatassembler.net/topic.php?p=208437#208437 |
|||
14 Feb 2019, 21:05 |
|
Tomasz Grysztar 14 Feb 2019, 21:31
Yes, of course, once you start switching between the modes it may become very tricky.
One thing to consider is that these preprocessing options only apply to lines read from source text, lines made by macros are not processed in such way (as they were normally not expected to contain comments, for example). Therefore once you define a macro that contains non-stripped semicolons, they are going to stay there even if you call this macro while having REMOVECOMMENTS mode enabled. |
|||
14 Feb 2019, 21:31 |
|
Tomasz Grysztar 15 Feb 2019, 06:57
Note that this applies to not just macros, but any symbolic values. Once a semicolon (or backslash at the end of line) gets "smuggled" into a value somewhere, it is no longer going to be stripped even with REMOVECOMMENTS option brought back. The option only applies to processing new lines read from source.
Code: retaincomments define smuggled ; macro detect_semicolon expr& match head;tail, :expr: repeat 1, L:__LINE__ display 'Semicolon detected in ',__FILE__,' [',`L,'].',13,10 end repeat end match end macro removecomments detect_semicolon ; this one gets stripped detect_semicolon smuggled |
|||
15 Feb 2019, 06:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.