diff options
Diffstat (limited to 'dimension/common.rules')
-rw-r--r-- | dimension/common.rules | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/dimension/common.rules b/dimension/common.rules index f4ce31f..b4cf631 100644 --- a/dimension/common.rules +++ b/dimension/common.rules @@ -726,16 +726,14 @@ INT: FLOAT { ; FLOAT_LITERAL: "integer" { - $$ = dmnsn_new_astnode(DMNSN_AST_INTEGER, @$); - $$.ptr = dmnsn_malloc(sizeof(long)); - *(long *)$$.ptr = strtol($1, NULL, 0); - dmnsn_free($1); + dmnsn_astnode string = dmnsn_new_astnode(DMNSN_AST_STRING, @$); + string.ptr = $1; + $$ = dmnsn_new_astnode1(DMNSN_AST_VAL, @$, string); } | "float" { - $$ = dmnsn_new_astnode(DMNSN_AST_FLOAT, @$); - $$.ptr = dmnsn_malloc(sizeof(double)); - *(double *)$$.ptr = strtod($1, NULL); - dmnsn_free($1); + dmnsn_astnode string = dmnsn_new_astnode(DMNSN_AST_STRING, @$); + string.ptr = $1; + $$ = dmnsn_new_astnode1(DMNSN_AST_VAL, @$, string); } ; |