Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

better null tracking, wrong var reference fixed #123

Merged
merged 1 commit into from

2 participants

@robertleeplummerjr

Just fixes, no changes in overall structure.

@zaach zaach merged commit 2bf8f93 into zaach:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 6 deletions.
  1. +7 −6 ports/php/template.php
View
13 ports/php/template.php
@@ -112,7 +112,7 @@ function parse($input)
}
}
- $errStr = "Parse error on line " . ($yylineno + 1) . ":\n" . $this->showPosition() . "\nExpecting " . implode(", ", $expected) . ", got '" . $this->terminals_[$symbol] . "'";
+ $errStr = "Parse error on line " . ($this->yylineno + 1) . ":\n" . $this->showPosition() . "\nExpecting " . implode(", ", $expected) . ", got '" . (isset($this->terminals_[$symbol]) ? $this->terminals_[$symbol] : 'NOTHING') . "'";
$this->parseError($errStr, array(
"text"=> $this->match,
@@ -214,7 +214,7 @@ function parse($input)
$r = $this->parser_performAction($yyval->S, $yytext, $yyleng, $yylineno, $action[1], $vstack, $lstack, $vstackCount - 1);
- if (empty($r) == false) {
+ if (isset($r)) {
return $r;
}
@@ -271,7 +271,8 @@ function parse($input)
"first_line"=> 1,
"first_column"=> 0,
"last_line"=> 1,
- "last_column"=> 0
+ "last_column"=> 0,
+ "range"=> array()
);
var $conditionsStack = array();
var $conditionStackCount = 0;
@@ -295,7 +296,7 @@ function setInput($input)
$this->yyloc["first_column"] = 0;
$this->yyloc["last_line"] = 1;
$this->yyloc["last_column"] = 0;
- if ($this->options->ranges) {
+ if (isset($this->options->ranges)) {
$this->yyloc['range'] = array(0,0);
}
$this->offset = 0;
@@ -317,7 +318,7 @@ function input()
} else {
$this->yyloc['last_column']++;
}
- if ($this->options->ranges) $this->yyloc['range'][1]++;
+ if (isset($this->options->ranges)) $this->yyloc['range'][1]++;
$this->_input = array_slice($this->_input, 1);
return $ch;
@@ -423,7 +424,7 @@ function next()
$this->match .= $match[0];
$this->matches = $match;
$this->yyleng = strlen($this->yytext);
- if ($this->options.ranges) {
+ if (isset($this->options->ranges)) {
$this->yyloc['range'] = array($this->offset, $this->offset += $this->yyleng);
}
$this->more = false;
Something went wrong with that request. Please try again.