Skip to content

Commit

Permalink
fix: fix bug on nil invoke parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuliquan committed Apr 7, 2024
1 parent 77151ce commit a7c3033
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ func (p *parser) parsePrimary() Node {
p.next()
expr := p.parseExpression(0)
p.expect(Bracket, ")") // "an opened parenthesis is not properly closed"
expr.SetParenthesis()
if expr != nil { // expr may be wrong, like not properly closed
expr.SetParenthesis()
}
return p.parsePostfixExpression(expr)
}

Expand Down

0 comments on commit a7c3033

Please sign in to comment.