picea/src/ControlStructure/ForToken.php
Dave Mc Nicoll bcd49884fc - WIP on RAW token
- WIP on caching interface
- Work done on easing template rendering for the controller
2019-10-04 08:38:11 -04:00

21 lines
464 B
PHP

<?php
namespace Picea\ControlStructure;
class ForToken implements ControlStructure {
public string $token = "for";
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
$uid = "$".uniqid("for_");
$context->iterationStack[] = [
'or' => false,
'uid' => $uid,
'token' => 'endfor',
];
return "<?php for ($arguments): {$uid} = 1; ?>";
}
}