diff options
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | lexer.c | 2 | ||||
-rw-r--r-- | lexer.h | 2 | ||||
-rw-r--r-- | parser.y | 1 |
4 files changed, 5 insertions, 1 deletions
@@ -1139,6 +1139,7 @@ ut_execute_op(struct ut_state *state, struct ut_opcode *op) case T_DOUBLE: case T_BOOL: case T_STRING: + case T_NULL: return json_object_get(op->val); case T_THIS: @@ -132,6 +132,7 @@ static const struct token reserved_words[] = { { T_BOOL, "true", 4, parse_bool }, { T_ELSE, "else", 4 }, { T_THIS, "this", 4 }, + { T_NULL, "null", 4 }, { T_NUMBER, "NaN", 3, parse_number }, { T_FOR, "for", 3 }, { T_IN, "in", 2 }, @@ -205,6 +206,7 @@ const char *tokennames[__T_MAX] = { [T_RETURN] = "'return'", [T_BREAK] = "'break'", [T_CONTINUE] = "'continue'", + [T_NULL] = "'null'", [T_THIS] = "'this'", //[T_LSTM] = "'{%'", //[T_RSTM] = "'%}'" @@ -19,7 +19,7 @@ #include "ast.h" -#define __T_MAX 70 +#define __T_MAX 71 #define T_EXCEPTION (__T_MAX + 0) #define T_CFUNC (__T_MAX + 1) #define T_RESSOURCE (__T_MAX + 2) @@ -260,6 +260,7 @@ primary_exp(A) ::= T_NUMBER(B). { A = B; } primary_exp(A) ::= T_DOUBLE(B). { A = B; } primary_exp(A) ::= T_STRING(B). { A = B; } primary_exp(A) ::= T_LABEL(B). { A = B; } +primary_exp(A) ::= T_NULL(B). { A = B; } primary_exp(A) ::= T_THIS(B). { A = B; } primary_exp(A) ::= array(B). { A = B; } primary_exp(A) ::= object(B). { A = B; } |