summaryrefslogtreecommitdiff
path: root/src/ste
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-09-21 20:46:15 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-09-21 20:46:15 +0200
commitceb262e08027531717f1a16faafc343e8d9656e3 (patch)
tree87fdc916042efeebcacc1ef66dd99a969b8e4c4e /src/ste
parentbf4d0598030b83be337bc505de842f7766009467 (diff)
downloadste-ceb262e08027531717f1a16faafc343e8d9656e3.tar.gz
ste-ceb262e08027531717f1a16faafc343e8d9656e3.tar.bz2
ste-ceb262e08027531717f1a16faafc343e8d9656e3.zip
Move to r7r namespace and r7r composer package vendor2.0.0
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.
Diffstat (limited to 'src/ste')
-rw-r--r--src/ste/ASTNode.php2
-rw-r--r--src/ste/BreakException.php2
-rw-r--r--src/ste/Calc.php2
-rw-r--r--src/ste/CantLoadTemplate.php2
-rw-r--r--src/ste/CantSaveTemplate.php2
-rw-r--r--src/ste/ContinueException.php2
-rw-r--r--src/ste/FatalRuntimeError.php2
-rw-r--r--src/ste/FilesystemStorageAccess.php2
-rw-r--r--src/ste/Misc.php2
-rw-r--r--src/ste/ParseCompileError.php2
-rw-r--r--src/ste/Parser.php2
-rw-r--r--src/ste/RuntimeError.php2
-rw-r--r--src/ste/STECore.php2
-rw-r--r--src/ste/STEStandardLibrary.php2
-rw-r--r--src/ste/Scope.php2
-rw-r--r--src/ste/StorageAccess.php2
-rw-r--r--src/ste/StorageAccessFailure.php2
-rw-r--r--src/ste/TagNode.php2
-rw-r--r--src/ste/TextNode.php2
-rw-r--r--src/ste/Transcompiler.php48
-rw-r--r--src/ste/VarNotInScope.php2
-rw-r--r--src/ste/VariableNode.php2
22 files changed, 45 insertions, 45 deletions
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 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
abstract class ASTNode
{
diff --git a/src/ste/BreakException.php b/src/ste/BreakException.php
index f91cf6a..8dea18f 100644
--- a/src/ste/BreakException.php
+++ b/src/ste/BreakException.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class BreakException extends \Exception
{
diff --git a/src/ste/Calc.php b/src/ste/Calc.php
index 660943d..39608c3 100644
--- a/src/ste/Calc.php
+++ b/src/ste/Calc.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* Class Calc contains static methods needed by <ste:calc />
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 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* An exception that a {@see StorageAccess} implementation can throw, if it is unable to load a template.
diff --git a/src/ste/CantSaveTemplate.php b/src/ste/CantSaveTemplate.php
index 92cdfe7..f0e64f6 100644
--- a/src/ste/CantSaveTemplate.php
+++ b/src/ste/CantSaveTemplate.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* An exception that a {@see StorageAccess} implementation can throw, if it is unable to save a template.
diff --git a/src/ste/ContinueException.php b/src/ste/ContinueException.php
index 784166e..b2606ac 100644
--- a/src/ste/ContinueException.php
+++ b/src/ste/ContinueException.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class ContinueException extends \Exception
{
diff --git a/src/ste/FatalRuntimeError.php b/src/ste/FatalRuntimeError.php
index 3f5183f..39bbd44 100644
--- a/src/ste/FatalRuntimeError.php
+++ b/src/ste/FatalRuntimeError.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* An Exception a tag can throw, if a fatal (irreparable) runtime error occurred.
diff --git a/src/ste/FilesystemStorageAccess.php b/src/ste/FilesystemStorageAccess.php
index ead2757..bbc169b 100644
--- a/src/ste/FilesystemStorageAccess.php
+++ b/src/ste/FilesystemStorageAccess.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* The default {@see StorageAccess} implementation for loading / saving templates into a directory structure.
diff --git a/src/ste/Misc.php b/src/ste/Misc.php
index 7118b28..e1ce2f9 100644
--- a/src/ste/Misc.php
+++ b/src/ste/Misc.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class Misc
{
diff --git a/src/ste/ParseCompileError.php b/src/ste/ParseCompileError.php
index bc0c252..55a908a 100644
--- a/src/ste/ParseCompileError.php
+++ b/src/ste/ParseCompileError.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* An exception thrown by the parser or compiler
diff --git a/src/ste/Parser.php b/src/ste/Parser.php
index a2f966c..4db8710 100644
--- a/src/ste/Parser.php
+++ b/src/ste/Parser.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
use LogicException;
diff --git a/src/ste/RuntimeError.php b/src/ste/RuntimeError.php
index 51fd29d..e7d80d5 100644
--- a/src/ste/RuntimeError.php
+++ b/src/ste/RuntimeError.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* An Exception that a tag can throw, if a non-fatal runtime error occurred.
diff --git a/src/ste/STECore.php b/src/ste/STECore.php
index a232616..a53e652 100644
--- a/src/ste/STECore.php
+++ b/src/ste/STECore.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
use Exception;
diff --git a/src/ste/STEStandardLibrary.php b/src/ste/STEStandardLibrary.php
index cd23fdf..b412440 100644
--- a/src/ste/STEStandardLibrary.php
+++ b/src/ste/STEStandardLibrary.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class STEStandardLibrary
{
diff --git a/src/ste/Scope.php b/src/ste/Scope.php
index 2ab4e7f..dad1c42 100644
--- a/src/ste/Scope.php
+++ b/src/ste/Scope.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class Scope implements \ArrayAccess
{
diff --git a/src/ste/StorageAccess.php b/src/ste/StorageAccess.php
index ec7f6bc..5118544 100644
--- a/src/ste/StorageAccess.php
+++ b/src/ste/StorageAccess.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* A StorageAccess implementation is used to access the templates from any storage.
diff --git a/src/ste/StorageAccessFailure.php b/src/ste/StorageAccessFailure.php
index 50dfc8a..15286ac 100644
--- a/src/ste/StorageAccessFailure.php
+++ b/src/ste/StorageAccessFailure.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
abstract class StorageAccessFailure extends \Exception
{
diff --git a/src/ste/TagNode.php b/src/ste/TagNode.php
index ce713c0..fe4d5ff 100644
--- a/src/ste/TagNode.php
+++ b/src/ste/TagNode.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class TagNode extends ASTNode
{
diff --git a/src/ste/TextNode.php b/src/ste/TextNode.php
index c46d71f..c287b50 100644
--- a/src/ste/TextNode.php
+++ b/src/ste/TextNode.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class TextNode extends ASTNode
{
diff --git a/src/ste/Transcompiler.php b/src/ste/Transcompiler.php
index 3955754..ec37a71 100644
--- a/src/ste/Transcompiler.php
+++ b/src/ste/Transcompiler.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
/**
* Contains the STE compiler. You'll only need this, if you want to manually compile a STE template.
@@ -27,23 +27,23 @@ class Transcompiler
/** @var callable[] builtins */
self::$builtins = [
- "if" => 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 <ste:cmp>.');\n}\n";
+ $code .= "default: throw new \\r7r\\ste\\RuntimeError('Unknown operator in <ste:cmp>.');\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 <ste:for>.');\n";
+ $code .= "if(\$${loopname}_step == 0)\n\tthrow new \\r7r\\ste\\RuntimeError('step can not be 0 in <ste:for>.');\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 <ste:\" . $tagname . \">.\");\n}";
+ $fxbody .= "foreach(\$mandatory_params as \$mp)\n{\n\tif(!isset(\$params[\$mp]))\n\t\tthrow new \\r7r\\ste\\RuntimeError(\"\$mp missing in <ste:\" . $tagname . \">.\");\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 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class VarNotInScope extends \Exception
{
diff --git a/src/ste/VariableNode.php b/src/ste/VariableNode.php
index cdffc3f..785e86a 100644
--- a/src/ste/VariableNode.php
+++ b/src/ste/VariableNode.php
@@ -1,6 +1,6 @@
<?php
-namespace kch42\ste;
+namespace r7r\ste;
class VariableNode extends ASTNode
{