(uxnasm) only ignore [ or ] if it is a whole token
Currently, tokens beginning with a [ or ] character are completely ignored, which forbids a macro from beginning with these characters. Specifically, a macro can be declared eg. as `%[x { ... }` but cannot be dereferenced as `[x`. This patch only ignores these tokens if they have a length of 1; otherwise the switch falls through to the default case.
This commit is contained in:
parent
1ac7c45d10
commit
a014cd8da9
|
@ -343,8 +343,8 @@ parse(char *w, FILE *f)
|
||||||
while((c = w[++i]))
|
while((c = w[++i]))
|
||||||
if(!writebyte(c)) return 0;
|
if(!writebyte(c)) return 0;
|
||||||
break;
|
break;
|
||||||
case '[': break; /* ignored */
|
case '[': if (slen(w) == 1) break; /* else FALLTHROUGH */
|
||||||
case ']': break; /* ignored */
|
case ']': if (slen(w) == 1) break; /* else FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
/* opcode */
|
/* opcode */
|
||||||
if(findopcode(w) || scmp(w, "BRK", 4)) {
|
if(findopcode(w) || scmp(w, "BRK", 4)) {
|
||||||
|
|
Loading…
Reference in New Issue