Skip to content

Commit

Permalink
feat: support literal string keys on declarative hashmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqueiroz committed Dec 9, 2024
1 parent 96b0fe1 commit 8135e38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ast/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (p *Parser) hashmap() Expression {

if !p.check(tokens.RIGHT_BRACE) {
for {
name := p.consume("Expect property name.", tokens.IDENTIFIER)
name := p.consume("Expect property name.", tokens.IDENTIFIER, tokens.STRING)
p.consume("Expect ':' after property identifier in hashmap", tokens.COLON)

properties[LiteralExpression{Value: name.Lexeme}] = p.expression()
Expand Down

0 comments on commit 8135e38

Please sign in to comment.