mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-13 23:36:03 +00:00
Use function for creating a literal expression node.
This commit is contained in:
parent
d6ff111149
commit
0fba6eea33
12
parse.c
12
parse.c
@ -792,9 +792,7 @@ EX_TREE *parse_unary(
|
||||
if (*cp == '\'') {
|
||||
/* 'x single ASCII character */
|
||||
cp++;
|
||||
tp = new_ex_tree();
|
||||
tp->type = EX_LIT;
|
||||
tp->data.lit = *cp & 0xff;
|
||||
tp = new_ex_lit(*cp & 0xff);
|
||||
tp->cp = ++cp;
|
||||
return tp;
|
||||
}
|
||||
@ -802,9 +800,7 @@ EX_TREE *parse_unary(
|
||||
if (*cp == '\"') {
|
||||
/* "xx ASCII character pair */
|
||||
cp++;
|
||||
tp = new_ex_tree();
|
||||
tp->type = EX_LIT;
|
||||
tp->data.lit = (cp[0] & 0xff) | ((cp[1] & 0xff) << 8);
|
||||
tp = new_ex_lit((cp[0] & 0xff) | ((cp[1] & 0xff) << 8));
|
||||
tp->cp = cp + 2;
|
||||
return tp;
|
||||
}
|
||||
@ -832,9 +828,7 @@ EX_TREE *parse_unary(
|
||||
if (*endcp == '.')
|
||||
endcp++;
|
||||
|
||||
tp = new_ex_tree();
|
||||
tp->type = EX_LIT;
|
||||
tp->data.lit = value;
|
||||
tp = new_ex_lit(value);
|
||||
tp->cp = endcp;
|
||||
|
||||
return tp;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user