- Added the missing continue token
This commit is contained in:
1 parent
7588748ebd
commit
67040db155
3 files changed
+16
-2
No files matched your search
@@ -8,7 +8,7 @@ class BlockToken implements ControlStructure {
|
|||||||
|
|
||||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
||||||
static $slotDefinitions = [];
|
static $slotDefinitions = [];
|
||||||
|
|
||||||
switch($token) {
|
switch($token) {
|
||||||
case "block":
|
case "block":
|
||||||
$slotDefinitions[] = $this->slotDefinitions();
|
$slotDefinitions[] = $this->slotDefinitions();
|
||||||
@@ -20,7 +20,7 @@ class BlockToken implements ControlStructure {
|
|||||||
|
|
||||||
case "arguments":
|
case "arguments":
|
||||||
$class = static::class;
|
$class = static::class;
|
||||||
|
|
||||||
return <<<PHP
|
return <<<PHP
|
||||||
<?php
|
<?php
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Picea\ControlStructure;
|
||||||
|
|
||||||
|
class ContinueToken implements ControlStructure {
|
||||||
|
|
||||||
|
public string $token = "continue";
|
||||||
|
|
||||||
|
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
||||||
|
return "<?php continue; ?>";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -49,6 +49,7 @@ class DefaultRegistrations implements LanguageRegistration
|
|||||||
$compiler->registerControlStructure(new \Picea\ControlStructure\SwitchToken());
|
$compiler->registerControlStructure(new \Picea\ControlStructure\SwitchToken());
|
||||||
$compiler->registerControlStructure(new \Picea\ControlStructure\DefaultToken());
|
$compiler->registerControlStructure(new \Picea\ControlStructure\DefaultToken());
|
||||||
$compiler->registerControlStructure(new \Picea\ControlStructure\BreakToken());
|
$compiler->registerControlStructure(new \Picea\ControlStructure\BreakToken());
|
||||||
|
$compiler->registerControlStructure(new \Picea\ControlStructure\ContinueToken());
|
||||||
$compiler->registerControlStructure(new \Picea\ControlStructure\ExtendsToken());
|
$compiler->registerControlStructure(new \Picea\ControlStructure\ExtendsToken());
|
||||||
$compiler->registerControlStructure(new \Picea\ControlStructure\SectionToken());
|
$compiler->registerControlStructure(new \Picea\ControlStructure\SectionToken());
|
||||||
$compiler->registerControlStructure(new \Picea\ControlStructure\BlockToken());
|
$compiler->registerControlStructure(new \Picea\ControlStructure\BlockToken());
|
||||||
|
|||||||
Reference in new issue
Block a user