- Small refractoring of code, merge tokens
- Completed block token
This commit is contained in:
1 parent
bf3816c3db
commit
ce4ef6351a
21 files changed
+370
-194
No files matched your search
@@ -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 ?>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user