mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
Forbid to redeclare variables, builtins, functions.
This commit is contained in:
+3
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user