mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Merge pull request #440 from ISSOtm/nested_brackets
Allow nested bracketed symbols
This commit is contained in:
@@ -666,6 +666,11 @@ size_t yylex_ReadBracketedSymbol(char *dest, size_t index)
|
|||||||
i += length;
|
i += length;
|
||||||
else
|
else
|
||||||
fatalerror("Illegal character escape '%c'", ch);
|
fatalerror("Illegal character escape '%c'", ch);
|
||||||
|
} else if (ch == '{') {
|
||||||
|
/* Handle nested symbols */
|
||||||
|
++pLexBuffer;
|
||||||
|
i += yylex_ReadBracketedSymbol(sym, i);
|
||||||
|
--pLexBuffer;
|
||||||
} else if (ch == ':' && !mode) { /* Only grab 1st colon */
|
} else if (ch == ':' && !mode) { /* Only grab 1st colon */
|
||||||
/* Use a whitelist of modes, which does prevent the
|
/* Use a whitelist of modes, which does prevent the
|
||||||
* use of some features such as precision,
|
* use of some features such as precision,
|
||||||
|
|||||||
5
test/asm/nested-brackets.asm
Normal file
5
test/asm/nested-brackets.asm
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
STRING equs "OK"
|
||||||
|
WRAPPER equs "TRIN"
|
||||||
|
PRINTT "{S{WRAPPER}G}\n"
|
||||||
|
|
||||||
|
PRINTT "{S{WRAPPER}G"
|
||||||
3
test/asm/nested-brackets.out
Normal file
3
test/asm/nested-brackets.out
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ERROR: nested-brackets.asm(5):
|
||||||
|
Missing }
|
||||||
|
OK
|
||||||
Reference in New Issue
Block a user