Forbid to redeclare variables, builtins, functions.

This commit is contained in:
Anton Medvedev
2023-08-22 22:30:07 +02:00
parent 3fad31af59
commit d237c8ab4e
3 changed files with 35 additions and 1 deletions
+3 -1
View File
@@ -193,11 +193,13 @@ func (p *parser) parseVariableDeclaration() Node {
value := p.parseExpression(0)
p.expect(Operator, ";")
node := p.parseExpression(0)
return &VariableDeclaratorNode{
let := &VariableDeclaratorNode{
Name: variableName.Value,
Value: value,
Expr: node,
}
let.SetLocation(variableName.Location)
return let
}
func (p *parser) parseConditional(node Node) Node {