- Fixed a compiler bug and section's token
This commit is contained in:
parent
6701a1cd59
commit
0ce9955631
|
@ -16,9 +16,9 @@ class Compiler
|
||||||
|
|
||||||
protected string $tagTokenClose = "%\}";
|
protected string $tagTokenClose = "%\}";
|
||||||
|
|
||||||
protected array $extensionList = [];
|
public array $extensionList = [];
|
||||||
|
|
||||||
protected ? LanguageRegistration $languageRegistration;
|
public ? LanguageRegistration $languageRegistration;
|
||||||
|
|
||||||
public function __construct(?LanguageRegistration $languageRegistration = null)
|
public function __construct(?LanguageRegistration $languageRegistration = null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,10 +7,10 @@ class SectionToken implements ControlStructure {
|
||||||
public string $token = "section";
|
public string $token = "section";
|
||||||
|
|
||||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
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 ) {
|
if ( $options ?? false ) {
|
||||||
$options = eval($options);
|
$options = eval("return $options;");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! ctype_alnum(str_replace([".", "\"", "'", "-", "_"], "", $name)) ) {
|
if ( ! ctype_alnum(str_replace([".", "\"", "'", "-", "_"], "", $name)) ) {
|
||||||
|
|
Loading…
Reference in New Issue