Add evaluation of %+unary expressions.

This is a first step towards expressions like <%1>+1 and even later R1+1.
This commit is contained in:
Olaf Seibert
2021-11-14 14:32:27 +01:00
parent 2aa43f17f7
commit 21e9410571
5 changed files with 86 additions and 24 deletions

12
parse.c
View File

@@ -892,17 +892,7 @@ EX_TREE *parse_unary(
cp = skipwhite(cp);
if (*cp == '%') { /* Register notation */
unsigned reg;
cp++;
reg = strtoul(cp, &cp, 8);
if (reg > 7)
return ex_err(NULL, cp);
/* This returns references to the built-in register symbols */
tp = new_ex_tree(EX_SYM);
tp->data.symbol = reg_sym[reg];
tp->cp = cp;
tp = new_ex_una(EX_REG, parse_unary(cp + 1));
return tp;
}