add parsing for while loops
This commit is contained in:
parent
a501393010
commit
9055a09e43
1 changed files with 8 additions and 0 deletions
|
|
@ -348,6 +348,14 @@ func (p *Parser) statement() Node {
|
|||
true,
|
||||
}
|
||||
|
||||
case TokenWhile:
|
||||
p.advance()
|
||||
|
||||
return &LoopNode{
|
||||
p.condition(),
|
||||
p.block(false),
|
||||
}
|
||||
|
||||
case TokenReturn:
|
||||
p.advance()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue