mirror of
https://github.com/open-simh/simtools.git
synced 2026-02-02 14:52:29 +00:00
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:
12
parse.c
12
parse.c
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user