Fix parser error that made it ignore the last line
This commit is contained in:
@@ -61,7 +61,7 @@ class ProgramParser
|
||||
}
|
||||
$program = new Program($firstWord->value);
|
||||
$lineBuffer = null;
|
||||
foreach ($words as $word) {
|
||||
while ($word = array_shift($words)) {
|
||||
if ($word->register === 'N') {
|
||||
if (!is_null($lineBuffer)) {
|
||||
$program->addBlock($lineBuffer);
|
||||
@@ -71,6 +71,9 @@ class ProgramParser
|
||||
}
|
||||
$lineBuffer->addWord($word);
|
||||
}
|
||||
if (!is_null($lineBuffer)) {
|
||||
$program->addBlock($lineBuffer);
|
||||
}
|
||||
|
||||
return $program;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user