feat: add null as value token

This commit is contained in:
samsonium
2026-10-17 21:23:50 +03:00
parent ce13d24985
commit 8c33464656
3 changed files with 9 additions and 12 deletions
+4 -11
View File
@@ -140,17 +140,10 @@ fzl_node_t *parse_primary(fzl_parser_t *parser)
if (!parser || !peek(parser))
return NULL;
if (is(parser, FZL_TOKTYPE_STR_LITERAL))
{
fzl_token_t *tok = consume(parser);
return fzl_mknode(FZL_NODETYPE_LITERAL, tok);
}
else if (is(parser, FZL_TOKTYPE_NUM_LITERAL))
{
fzl_token_t *tok = consume(parser);
return fzl_mknode(FZL_NODETYPE_LITERAL, tok);
}
else if (is(parser, FZL_TOKTYPE_BOOL_LITERAL))
if (is(parser, FZL_TOKTYPE_STR_LITERAL) ||
is(parser, FZL_TOKTYPE_NUM_LITERAL) ||
is(parser, FZL_TOKTYPE_BOOL_LITERAL) ||
is(parser, FZL_TOKTYPE_NULL_LITERAL))
{
fzl_token_t *tok = consume(parser);
return fzl_mknode(FZL_NODETYPE_LITERAL, tok);