- Fixed a compiler bug and section's token

This commit is contained in:
Dave M. 2019-12-10 14:31:27 -05:00
parent 6701a1cd59
commit 0ce9955631
2 changed files with 4 additions and 4 deletions

View File

@ -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)
{

View File

@ -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)) ) {