Skip to content

Commit

Permalink
fix(parser): return correct type for 'null' literal
Browse files Browse the repository at this point in the history
  • Loading branch information
MlkMahmud committed Apr 21, 2024
1 parent 4038c20 commit c4f87ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (parse *Parser) parseLiteralExpression() types.Literal {
}

if helpers.IsOneOfKeywords(token, []string{"null"}) {
return types.Literal{Type: types.ThisLiteral, Value: token.Lexeme}
return types.Literal{Type: types.NullLiteral, Value: token.Lexeme}
}

if helpers.IsOneOfKeywords(token, []string{"this"}) {
Expand Down

0 comments on commit c4f87ba

Please sign in to comment.