mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Fix do while
Test wasn't adequate and I didn't pass an extra value to the node data
This commit is contained in:
parent
59ca86eff7
commit
810a570779
@ -16,6 +16,13 @@ do {
|
||||
|
||||
assert(Num == 1000)
|
||||
|
||||
local Ran = 0
|
||||
do {
|
||||
Ran = 1
|
||||
} while (0)
|
||||
|
||||
assert(Ran)
|
||||
|
||||
Calls = 1
|
||||
Inc = 1
|
||||
function number calls() {
|
||||
|
@ -520,7 +520,7 @@ function Parser:Stmt()
|
||||
if self:Consume(TokenVariant.Keyword, Keyword.Do) then
|
||||
local trace, block = self:Prev().trace, self:Block()
|
||||
self:Assert( self:Consume(TokenVariant.Keyword, Keyword.While), "while expected after do and code block (do {...} )")
|
||||
return Node.new(NodeVariant.While, { self:Condition(), block }, trace:stitch(self:Prev().trace))
|
||||
return Node.new(NodeVariant.While, { self:Condition(), block, true }, trace:stitch(self:Prev().trace))
|
||||
end
|
||||
|
||||
-- Event
|
||||
|
Loading…
Reference in New Issue
Block a user