summaryrefslogtreecommitdiff
path: root/src/ste/Parser.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/ste/Parser.php')
-rw-r--r--src/ste/Parser.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ste/Parser.php b/src/ste/Parser.php
index a588203..a2f966c 100644
--- a/src/ste/Parser.php
+++ b/src/ste/Parser.php
@@ -443,12 +443,15 @@ class Parser
*/
private function parse_var(int $openedat, bool $curly): VariableNode
{
- $varnode = new VariableNode($this->name, $openedat);
- $varnode->name = $this->get_name();
+ $varname = $this->get_name();
+
+ $arrayfields = [];
if (!$this->eof()) {
- $varnode->arrayfields = $this->parse_array();
+ $arrayfields = $this->parse_array();
}
+ $varnode = new VariableNode($this->name, $openedat, $varname, $arrayfields);
+
if ($curly && ($this->next() != "}")) {
throw new ParseCompileError("Unclosed '\${'", $this->name, $openedat);
}