File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -4147,14 +4147,17 @@ public function throwError($msg)
41474147 return ;
41484148 }
41494149
4150+ $ line = $ this ->sourceLine ;
4151+ $ column = $ this ->sourceColumn ;
4152+
4153+ $ loc = isset ($ this ->sourceNames [$ this ->sourceIndex ])
4154+ ? $ this ->sourceNames [$ this ->sourceIndex ] . " on line $ line, at column $ column "
4155+ : "line: $ line, column: $ column " ;
4156+
41504157 if (func_num_args () > 1 ) {
41514158 $ msg = call_user_func_array ('sprintf ' , func_get_args ());
41524159 }
41534160
4154- $ line = $ this ->sourceLine ;
4155- $ loc = isset ($ this ->sourceNames [$ this ->sourceIndex ])
4156- ? $ this ->sourceNames [$ this ->sourceIndex ] . " on line $ line "
4157- : "line: $ line " ;
41584161 $ msg = "$ msg: $ loc " ;
41594162
41604163 $ callStackMsg = $ this ->callStackMessage ();
Original file line number Diff line number Diff line change @@ -130,9 +130,11 @@ public function getSourceName()
130130 */
131131 public function throwParseError ($ msg = 'parse error ' )
132132 {
133- list ($ line , /* $column */ ) = $ this ->getSourcePosition ($ this ->count );
133+ list ($ line , $ column ) = $ this ->getSourcePosition ($ this ->count );
134134
135- $ loc = empty ($ this ->sourceName ) ? "line: $ line " : "$ this ->sourceName on line $ line " ;
135+ $ loc = empty ($ this ->sourceName )
136+ ? "line: $ line, column: $ column "
137+ : "$ this ->sourceName on line $ line, at column $ column " ;
136138
137139 if ($ this ->peek ("(.*?)( \n|$) " , $ m , $ this ->count )) {
138140 throw new ParserException ("$ msg: failed at ` $ m [1 ]` $ loc " );
You can’t perform that action at this time.
0 commit comments