- Added while/endwhile and do/while syntaxes
- Fix the abstractclass requirement of parse() function
This commit is contained in:
1 parent
33298ff2e4
commit
bb29a56077
36 files changed
+115
-73
No files matched your search
@@ -3,5 +3,5 @@
|
||||
namespace Picea\Extension;
|
||||
|
||||
interface Extension {
|
||||
public function parse(\Picae\Compiler\Context &$context, string $sourceCode, string $token);
|
||||
public function parse(\Picea\Compiler\Context &$context, string $sourceCode, string $token);
|
||||
}
|
||||
@@ -10,7 +10,7 @@ class JsonExtension implements Extension, FunctionExtension {
|
||||
|
||||
public int $flags = JSON_HEX_TAG | \JSON_HEX_QUOT | \JSON_THROW_ON_ERROR | \JSON_UNESCAPED_UNICODE;
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token)
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token)
|
||||
{
|
||||
$flag = $this->flags;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class LanguageExtension implements Extension, FunctionExtension {
|
||||
];
|
||||
}
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) : string
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) : string
|
||||
{
|
||||
switch($token) {
|
||||
case "language.set":
|
||||
|
||||
@@ -25,7 +25,7 @@ class MoneyExtension implements Extension {
|
||||
$context->pushFunction("money", [ $this, 'money' ]);
|
||||
}
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) {
|
||||
return "<?php echo money($arguments) ?>";
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class PhpExtension implements Extension {
|
||||
|
||||
public array $token = [ "php" ];
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) {
|
||||
return "<?php $arguments ?>";
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ class PrintExtension implements Extension {
|
||||
$this->encoding = ini_get("default_charset");
|
||||
}
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) : string
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) : string
|
||||
{
|
||||
switch($token) {
|
||||
case 'print':
|
||||
|
||||
@@ -19,7 +19,7 @@ class TitleExtension implements Extension {
|
||||
$context->pushFunction("title", [ $this, 'handleTitle' ]);
|
||||
}
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) {
|
||||
return "<?php echo title($arguments) ?>";
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ PATTERN;
|
||||
$this->register($context);
|
||||
}
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) : ?string
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) : ?string
|
||||
{
|
||||
switch($token) {
|
||||
case "asset":
|
||||
|
||||
Reference in new issue
Block a user