Merge pull request #440 from ISSOtm/nested_brackets

Allow nested bracketed symbols
This commit is contained in:
Eldred Habert
2019-11-03 16:40:34 +01:00
committed by GitHub
3 changed files with 13 additions and 0 deletions

View File

@@ -666,6 +666,11 @@ size_t yylex_ReadBracketedSymbol(char *dest, size_t index)
i += length;
else
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 */
/* Use a whitelist of modes, which does prevent the
* use of some features such as precision,

View File

@@ -0,0 +1,5 @@
STRING equs "OK"
WRAPPER equs "TRIN"
PRINTT "{S{WRAPPER}G}\n"
PRINTT "{S{WRAPPER}G"

View File

@@ -0,0 +1,3 @@
ERROR: nested-brackets.asm(5):
Missing }
OK