summaryrefslogtreecommitdiff
path: root/src/VariableNode.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2014-05-24 14:55:11 +0200
committerKevin Chabowski <kevin@kch42.de>2014-05-24 14:55:11 +0200
commitd48be01fff31a7a9d611802721aa70532d251c3a (patch)
tree53ac39214a27855a6521f91ea448e39ffcd7866b /src/VariableNode.php
parent3c51baa4167d5a68ff010dc81525b9340c5f1329 (diff)
downloadste-d48be01fff31a7a9d611802721aa70532d251c3a.tar.gz
ste-d48be01fff31a7a9d611802721aa70532d251c3a.tar.bz2
ste-d48be01fff31a7a9d611802721aa70532d251c3a.zip
Moved to src/ste for psr-4 compliance1.0.0
Diffstat (limited to 'src/VariableNode.php')
-rw-r--r--src/VariableNode.php25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/VariableNode.php b/src/VariableNode.php
deleted file mode 100644
index b312e81..0000000
--- a/src/VariableNode.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace kch42\ste;
-
-class VariableNode extends ASTNode {
- public $name;
- public $arrayfields = array();
- public function transcompile() {
- $varaccess = '@$ste->vars[' . (is_numeric($this->name) ? $this->name : '"' . Misc::escape_text($this->name) . '"'). ']';
- foreach($this->arrayfields as $af) {
- if((count($af) == 1) and ($af[0] instanceof TextNode) and is_numeric($af[0]->text)) {
- $varaccess .= '[' . $af->text . ']';
- } else {
- $varaccess .= '[' . implode(".", array_map(function($node) {
- if($node instanceof TextNode) {
- return "\"" . Misc::escape_text($node->text) . "\"";
- } else if($node instanceof VariableNode) {
- return $node->transcompile();
- }
- }, $af)). ']';
- }
- }
- return $varaccess;
- }
-}