flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Escaping inside of a macro |
Author |
|
revolution 16 Feb 2012, 05:05
The outer macro is looking for things to process. If you don't escape something then the outer macro will attempt to make sense of it. If you do escape it then the outer macro will simply pass it on unhandled and untouched to the inner macro(s) and strip one level of escape backslashes.
[edit] Strictly speaking the opening curly bracket does not need to be escaped since the macro processor cannot make any sense of it. But I still do escape them just to remind myself, and make it clear to myself, both the number of escape levels currently entered and that the following block is a new inner macro. |
|||
16 Feb 2012, 05:05 |
|
l_inc 16 Feb 2012, 13:22
yoshimitsu
You can escape any symbol (see section 1.2.1, second paragraph for description of what a symbol is) in any macroblock (macro, struc, match, rept, irp, irps). Every symbol is either interpreted according to the current context, or unescaped by removing a single leading backslash from the character sequence, while a macroblock is expanded. That's all, you need to know about escaping. What symbols and with how many slashes you escape them depends on the moment you want those symbols to be interpreted. Consider the following example for training: Code: struc asComputationDestination { macro . [\.] \{ common match ==\\.,\. \\{ irps \\\.,\\. \\\{ display \\\`\\\. \\\} \\} \} } x asComputationDestination x = 20*10/20+1 (the macro does not compute anything. It just displays the expression) |
|||
16 Feb 2012, 13:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.