Skip to content

Commit

Permalink
add comment for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
hidetatz committed Sep 3, 2023
1 parent b16d491 commit 267d95e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ func (p *parser) primary() node {
// struct initialize.
// ident{varname: value, ...}
// this is parsed as ident + dict
// Because we need to determine "{" belongs to struct initialization or block statement,
// we try to read as dict first, then return as struct init if succeeds.
// If fail, return just ident assuming "{" belongs to block.
if d := p.try(p.dict); d != nil {
return &ndStructInit{tok: p.cur, name: i, values: d}
}
Expand Down

0 comments on commit 267d95e

Please sign in to comment.