summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Parser.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/Parser.php b/Parser.php
index 1ca0798..e3b8d07 100644
--- a/Parser.php
+++ b/Parser.php
@@ -34,6 +34,9 @@ class Parser {
return $c;
}
+ private function eof() {
+ return ($this->off == $this->len);
+ }
private function back($n = 1) {
if($n <= 0) {
@@ -349,7 +352,9 @@ class Parser {
private function parse_var($openedat, $curly) {
$varnode = new VariableNode($this->name, $openedat);
$varnode->name = $this->get_name();
- $varnode->arrayfields = $this->parse_array();
+ if(!$this->eof()) {
+ $varnode->arrayfields = $this->parse_array();
+ }
if(($curly) && ($this->next() != "}")) {
throw new ParseCompileError("Unclosed '\${'", $this->name, $openedat);