mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-26 20:21:45 +00:00
Fix .asciz <expr>... where an overzealous parsing wants to parse too much of the remaining text
In particular, the example was .asciz <cr><lf>/<SOH>/ where it tried to make a division betweem <lf> and the delimited string /<SOH>/.
This commit is contained in:
23
parse.c
23
parse.c
@@ -863,3 +863,26 @@ EX_TREE *parse_expr(
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/*
|
||||
parse_unary_expr It parses and evaluates
|
||||
an arithmetic expression but only a unary: (op)value or <expr>.
|
||||
In particular, it doesn't try to divide in <lf>/SOH/.
|
||||
*/
|
||||
|
||||
EX_TREE *parse_unary_expr(
|
||||
char *cp,
|
||||
int undef)
|
||||
{
|
||||
EX_TREE *expr;
|
||||
EX_TREE *value;
|
||||
|
||||
expr = parse_unary(cp); /* Parse into a tree */
|
||||
value = evaluate(expr, undef); /* Perform the arithmetic */
|
||||
value->cp = expr->cp; /* Pointer to end of text is part of
|
||||
the rootmost node */
|
||||
free_tree(expr); /* Discard parse in favor of
|
||||
evaluation */
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user