From ceb262e08027531717f1a16faafc343e8d9656e3 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Mon, 21 Sep 2020 20:46:15 +0200 Subject: Move to r7r namespace and r7r composer package vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's face it, no one but my CMS Ratatöskr (r7r for short) uses this template engine anyway. Also it's a good excuse to get rid of more remnants of my old kch42 nickname. --- src/ste/ASTNode.php | 2 +- src/ste/BreakException.php | 2 +- src/ste/Calc.php | 2 +- src/ste/CantLoadTemplate.php | 2 +- src/ste/CantSaveTemplate.php | 2 +- src/ste/ContinueException.php | 2 +- src/ste/FatalRuntimeError.php | 2 +- src/ste/FilesystemStorageAccess.php | 2 +- src/ste/Misc.php | 2 +- src/ste/ParseCompileError.php | 2 +- src/ste/Parser.php | 2 +- src/ste/RuntimeError.php | 2 +- src/ste/STECore.php | 2 +- src/ste/STEStandardLibrary.php | 2 +- src/ste/Scope.php | 2 +- src/ste/StorageAccess.php | 2 +- src/ste/StorageAccessFailure.php | 2 +- src/ste/TagNode.php | 2 +- src/ste/TextNode.php | 2 +- src/ste/Transcompiler.php | 48 ++++++++++++++++++------------------- src/ste/VarNotInScope.php | 2 +- src/ste/VariableNode.php | 2 +- 22 files changed, 45 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/ste/ASTNode.php b/src/ste/ASTNode.php index 4eb0348..efb7d65 100644 --- a/src/ste/ASTNode.php +++ b/src/ste/ASTNode.php @@ -1,6 +1,6 @@ diff --git a/src/ste/CantLoadTemplate.php b/src/ste/CantLoadTemplate.php index 92604cc..655248f 100644 --- a/src/ste/CantLoadTemplate.php +++ b/src/ste/CantLoadTemplate.php @@ -1,6 +1,6 @@ self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_if"]), - "cmp" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_cmp"]), - "not" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_not"]), - "even" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_even"]), - "for" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_for"]), - "foreach" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_foreach"]), - "infloop" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_infloop"]), - "break" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_break"]), - "continue" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_continue"]), - "block" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_block"]), - "load" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_load"]), - "mktag" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_mktag"]), - "tagcontent" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_tagcontent"]), - "set" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_set"]), - "setlocal" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_setlocal"]), - "get" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_get"]), - "calc" => self::mark_builtin_callable(["\\kch42\\ste\\Transcompiler", "builtin_calc"]) + "if" => self::mark_builtin_callable([self::class, "builtin_if"]), + "cmp" => self::mark_builtin_callable([self::class, "builtin_cmp"]), + "not" => self::mark_builtin_callable([self::class, "builtin_not"]), + "even" => self::mark_builtin_callable([self::class, "builtin_even"]), + "for" => self::mark_builtin_callable([self::class, "builtin_for"]), + "foreach" => self::mark_builtin_callable([self::class, "builtin_foreach"]), + "infloop" => self::mark_builtin_callable([self::class, "builtin_infloop"]), + "break" => self::mark_builtin_callable([self::class, "builtin_break"]), + "continue" => self::mark_builtin_callable([self::class, "builtin_continue"]), + "block" => self::mark_builtin_callable([self::class, "builtin_block"]), + "load" => self::mark_builtin_callable([self::class, "builtin_load"]), + "mktag" => self::mark_builtin_callable([self::class, "builtin_mktag"]), + "tagcontent" => self::mark_builtin_callable([self::class, "builtin_tagcontent"]), + "set" => self::mark_builtin_callable([self::class, "builtin_set"]), + "setlocal" => self::mark_builtin_callable([self::class, "builtin_setlocal"]), + "get" => self::mark_builtin_callable([self::class, "builtin_get"]), + "calc" => self::mark_builtin_callable([self::class, "builtin_calc"]) ]; } @@ -156,7 +156,7 @@ class Transcompiler }, $operators )); - $code .= "default: throw new \\kch42\\ste\\RuntimeError('Unknown operator in .');\n}\n"; + $code .= "default: throw new \\r7r\\ste\\RuntimeError('Unknown operator in .');\n}\n"; } return $code; } @@ -235,7 +235,7 @@ class Transcompiler $loopbody = self::indent_code("{\n" . self::loopbody(self::indent_code($loopbody)) . "\n}\n"); if ($step === null) { - $code .= "if(\$${loopname}_step == 0)\n\tthrow new \\kch42\\ste\\RuntimeError('step can not be 0 in .');\n"; + $code .= "if(\$${loopname}_step == 0)\n\tthrow new \\r7r\\ste\\RuntimeError('step can not be 0 in .');\n"; $code .= "if(\$${loopname}_step > 0)\n{\n"; $code .= "\tfor(\$${loopname}_counter = \$${loopname}_start; \$${loopname}_counter <= \$${loopname}_stop; \$${loopname}_counter += \$${loopname}_step)\n"; $code .= $loopbody; @@ -342,7 +342,7 @@ class Transcompiler */ private static function builtin_break(TagNode $ast): string { - return "throw new \\kch42\\ste\\BreakException();\n"; + return "throw new \\r7r\\ste\\BreakException();\n"; } /** @@ -351,7 +351,7 @@ class Transcompiler */ private static function builtin_continue(TagNode $ast): string { - return "throw new \\kch42\\ste\\ContinueException();\n"; + return "throw new \\r7r\\ste\\ContinueException();\n"; } /** @@ -421,7 +421,7 @@ class Transcompiler $code .= self::_transcompile($ast->params["mandatory"]); $code .= "\$outputstack_i--;\n\$mandatory_params = explode('|', array_pop(\$outputstack));\n"; - $fxbody .= "foreach(\$mandatory_params as \$mp)\n{\n\tif(!isset(\$params[\$mp]))\n\t\tthrow new \\kch42\\ste\\RuntimeError(\"\$mp missing in .\");\n}"; + $fxbody .= "foreach(\$mandatory_params as \$mp)\n{\n\tif(!isset(\$params[\$mp]))\n\t\tthrow new \\r7r\\ste\\RuntimeError(\"\$mp missing in .\");\n}"; } $fxbody .= self::_transcompile($ast->sub); @@ -528,7 +528,7 @@ class Transcompiler private static function loopbody(string $code): string { - return "try\n{\n" . self::indent_code($code) . "\n}\ncatch(\\kch42\\ste\\BreakException \$e) { break; }\ncatch(\\kch42\\ste\\ContinueException \$e) { continue; }\n"; + return "try\n{\n" . self::indent_code($code) . "\n}\ncatch(\\r7r\\ste\\BreakException \$e) { break; }\ncatch(\\r7r\\ste\\ContinueException \$e) { continue; }\n"; } /** diff --git a/src/ste/VarNotInScope.php b/src/ste/VarNotInScope.php index 6dc5eda..bc417a9 100644 --- a/src/ste/VarNotInScope.php +++ b/src/ste/VarNotInScope.php @@ -1,6 +1,6 @@