- WIP on RAW token
- WIP on caching interface - Work done on easing template rendering for the controller
This commit is contained in:
1 parent
f8e3dbd60f
commit
bcd49884fc
37 files changed
+381
-107
No files matched your search
@@ -0,0 +1,55 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Picea\Language;
|
||||
|
||||
use Picea\Compiler;
|
||||
|
||||
class DefaultRegistrations implements LanguageRegistration
|
||||
{
|
||||
public function registerAll(Compiler $compiler) : void
|
||||
{
|
||||
$this->registerSyntax($compiler);
|
||||
$this->registerControlStructure($compiler);
|
||||
$this->registerExtension($compiler);
|
||||
}
|
||||
|
||||
public function registerSyntax(Compiler $compiler) : void
|
||||
{
|
||||
$compiler->registerSyntax(new \Picea\Syntax\PhpTagToken());
|
||||
$compiler->registerSyntax(new \Picea\Syntax\CommentToken());
|
||||
$compiler->registerSyntax(new \Picea\Syntax\EchoRawToken());
|
||||
$compiler->registerSyntax(new \Picea\Syntax\EchoSafeToken());
|
||||
}
|
||||
|
||||
public function registerControlStructure(Compiler $compiler) : void
|
||||
{
|
||||
# @TODO -- a rewrite on the compiler has to be done to accept this kind of functionnality
|
||||
# $compiler->registerControlStructure(new \Picea\ControlStructure\RawToken());
|
||||
# $compiler->registerControlStructure(new \Picea\ControlStructure\EndRawToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\NamespaceToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\UseToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\IfToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\ElseToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\ElseIfToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\EndIfToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\ForeachToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\ForToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\OrToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\EndforeachToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\EndforToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\SwitchToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\CaseToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\DefaultToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\BreakToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\EndCaseToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\EndSwitchToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\ExtendsToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\SectionToken());
|
||||
$compiler->registerControlStructure(new \Picea\ControlStructure\EndSectionToken());
|
||||
}
|
||||
|
||||
public function registerExtension(Compiler $compiler) : void
|
||||
{
|
||||
$compiler->registerExtension(new \Picea\Extension\JsonExtension());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Picea\Language;
|
||||
|
||||
use Picea\Compiler;
|
||||
|
||||
interface LanguageRegistration
|
||||
{
|
||||
public function registerSyntax(Compiler $compiler) : void;
|
||||
|
||||
public function registerControlStructure(Compiler $compiler) : void;
|
||||
|
||||
public function registerExtension(Compiler $compiler) : void;
|
||||
}
|
||||
Reference in new issue
Block a user