- A lot of bugfixes made for this release.

This commit is contained in:
mcndave committed 2021-02-16 03:17:32 +00:00
1 parent 4e909b2840
commit 8df38b568c
13 files changed
+159 -71

No files matched your search

+5 -2
View File
@@ -4,10 +4,13 @@ namespace Picea\ControlStructure;
class ForeachToken implements ControlStructure {
public array $token = [ "foreach", "endforeach" ];
public array $token = [ "foreach", "endforeach", "continue" ];
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
switch($token) {
case "continue":
return "<?php continue; ?>";
case "foreach":
$name = "$".uniqid("foreach_");
@@ -27,7 +30,7 @@ class ForeachToken implements ControlStructure {
'token' => 'endforeach',
];
return "<?php foreach ($arguments): $name = ( $name ?? 0 ) + 1; ; ?>";
return "<?php foreach ($arguments): $name = ( $name ?? 0 ) + 1; ?>";
case "endforeach":
if ( end($context->iterationStack)['or'] === false ) {