- Work on Language Handler and extension.
- Added an URL extension which allows routes and URLs. - Fixed some bug within ClassTemplate
This commit is contained in:
1 parent
a64989af9f
commit
ddc3ae704a
10 files changed
+267
-82
No files matched your search
+10
-3
@@ -23,11 +23,11 @@ class Compiler
|
||||
public function __construct(?LanguageRegistration $languageRegistration = null)
|
||||
{
|
||||
$this->languageRegistration = $languageRegistration;
|
||||
$this->languageRegistration->registerAll($this);
|
||||
}
|
||||
|
||||
public function compile(Compiler\Context $context) : string
|
||||
{
|
||||
$this->languageRegistration->registerAll($this);
|
||||
$context->compiler = $this;
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,7 @@ class Compiler
|
||||
|
||||
public function registerControlStructure(ControlStructure\ControlStructure $controlStructureObject) : self
|
||||
{
|
||||
foreach($controlStructureObject->tokens ?? (array) $controlStructureObject->token as $token) {
|
||||
foreach($controlStructureObject->tokens ?? (array) ( $controlStructureObject->token ?? [] ) as $token) {
|
||||
$this->tagList[$token] = $controlStructureObject;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class Compiler
|
||||
|
||||
public function registerExtension(Extension\Extension $extension) : self
|
||||
{
|
||||
foreach($extension->tokens ?? (array) $extension->token as $token) {
|
||||
foreach($extension->tokens ?? (array) ( $extension->token ?? [] ) as $token) {
|
||||
$this->extensionList[$token] = $extension;
|
||||
}
|
||||
|
||||
@@ -108,4 +108,11 @@ class Compiler
|
||||
|
||||
return $this->extensionList[$name];
|
||||
}
|
||||
|
||||
public function exportFunctions() : void
|
||||
{
|
||||
static $caching = [];
|
||||
eval( $this->context->renderFunctions() );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user