- Small refractoring of code, merge tokens

- Completed block token
This commit is contained in:
Dave Mc Nicoll committed 2020-05-04 22:50:02 -04:00
1 parent bf3816c3db
commit ce4ef6351a
21 files changed
+370 -194

No files matched your search

+14 -2
View File
@@ -4,10 +4,22 @@ namespace Picea\ControlStructure;
class IfToken implements ControlStructure {
public string $token = "if";
public array $token = [ "if", "else", "elseif", "endif" ];
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
return "<?php if ($arguments): ?>";
switch($token) {
case "if":
return "<?php if ($arguments): ?>";
case "else":
return "<?php else: ?>";
case "elseif":
return "<?php elseif ($arguments): ?>";
case "endif":
return "<?php endif ?>";
}
}
}