From 0fba6eea3399e235a91859aa0b26e1d683d43662 Mon Sep 17 00:00:00 2001 From: Olaf Seibert Date: Sun, 8 Nov 2015 20:51:45 +0100 Subject: [PATCH] Use function for creating a literal expression node. --- parse.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/parse.c b/parse.c index 1fad17f..daddb58 100644 --- a/parse.c +++ b/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;