Fixed variable lifetime in loops
This commit is contained in:
parent
43a6e85929
commit
c2b42fe2ea
11 changed files with 90 additions and 18 deletions
|
@ -30,6 +30,10 @@ func toASTNode(tokens token.List) (Node, error) {
|
|||
word := tokens[0].Text()
|
||||
|
||||
if word == keyword.Return {
|
||||
if len(tokens) == 1 {
|
||||
return &Return{}, nil
|
||||
}
|
||||
|
||||
value := expression.Parse(tokens[1:])
|
||||
return &Return{Value: value}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue