flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Suggestion: if-else match |
Author |
|
l_inc 23 Nov 2014, 14:22
m3ntal
Assembly and preprocessing directives won't play together anyway. But an elsematch has already been requested. Here's an alternative interesting way without an additional preprocessor constant (suggested by baldr): Code: match a, p { ; ... rept 0 \{ } rept 1 { match b, p \{ ; ... rept 0 \\{ \} rept 1 \{ match c, p \\{ ; ... rept 0 \\\{ \\} rept 1 \\{ match d, p \\\{ ; ... rept 0 \\\\{ \\\} rept 1 \\\{ ; ... \\\}\\}\}} You may wanna try to introduce a bit of a simplified syntactic sugar using the fix directive. _________________ Faith is a superposition of knowledge and fallacy |
|||
23 Nov 2014, 14:22 |
|
m3ntal 23 Nov 2014, 15:04
Thanks, I didn't notice that. It is possible, though. "if-else + match" could be preprocessed just like match and if-else without match would be the normal assembly directives which would be skipped.
Tomasz Grysztar wrote: I've been thinking about some kind of elsematch directive ever since I introduced match. But I never decided on a good name for it... and since it was possible to manage (though not as elegantly) with match alone, I repeatedly dropped it from my "to do" list. Code: match if ... match else ... |
|||
23 Nov 2014, 15:04 |
|
m3ntal 24 Nov 2014, 04:33
I suggest this syntax:
Code: match if a,b { ; ... } match else if a,b { ; ... } match else { ; ... } match end |
|||
24 Nov 2014, 04:33 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.