From 0ce9955631ef626c6f7d998b7df483d675ba46a8 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Tue, 10 Dec 2019 14:31:27 -0500 Subject: [PATCH] - Fixed a compiler bug and section's token --- src/Compiler.php | 4 ++-- src/ControlStructure/SectionToken.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compiler.php b/src/Compiler.php index ca93999..f5de5f2 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -16,9 +16,9 @@ class Compiler protected string $tagTokenClose = "%\}"; - protected array $extensionList = []; + public array $extensionList = []; - protected ? LanguageRegistration $languageRegistration; + public ? LanguageRegistration $languageRegistration; public function __construct(?LanguageRegistration $languageRegistration = null) { diff --git a/src/ControlStructure/SectionToken.php b/src/ControlStructure/SectionToken.php index 01502c9..293f9d5 100644 --- a/src/ControlStructure/SectionToken.php +++ b/src/ControlStructure/SectionToken.php @@ -7,10 +7,10 @@ class SectionToken implements ControlStructure { public string $token = "section"; public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) { - list($name, $options) = array_pad(explode(',', $arguments), 2, null); + list($name, $options) = array_pad(explode(',', $arguments, 2), 2, null); if ( $options ?? false ) { - $options = eval($options); + $options = eval("return $options;"); } if ( ! ctype_alnum(str_replace([".", "\"", "'", "-", "_"], "", $name)) ) {