diff options
-rw-r--r-- | builtin.c | 3 | ||||
-rw-r--r-- | parser.y | 10 |
2 files changed, 9 insertions, 4 deletions
@@ -868,9 +868,6 @@ static block bind_bytecoded_builtins(block b) { { struct bytecoded_builtin builtin_defs[] = { {"empty", gen_op_simple(BACKTRACK)}, - {"false", gen_const(jv_false())}, - {"true", gen_const(jv_true())}, - {"null", gen_const(jv_null())}, {"not", gen_condbranch(gen_const(jv_false()), gen_const(jv_true()))} }; @@ -638,7 +638,15 @@ FORMAT { jv_free($2); } | IDENT { - $$ = gen_location(@$, locations, gen_call(jv_string_value($1), gen_noop())); + const char *s = jv_string_value($1); + if (strcmp(s, "false") == 0) + $$ = gen_const(jv_false()); + else if (strcmp(s, "true") == 0) + $$ = gen_const(jv_true()); + else if (strcmp(s, "null") == 0) + $$ = gen_const(jv_null()); + else + $$ = gen_location(@$, locations, gen_call(s, gen_noop())); jv_free($1); } | IDENT '(' Args ')' { |