Skip to content
Snippets Groups Projects
Commit 370d3651 authored by David Norlin's avatar David Norlin
Browse files

To get the right context in the thrown error string.

Rev: lib/modules/Parser.pmod/C.pmod:1.25
Rev: lib/modules/Parser.pmod/Pike.pmod:1.10
parent 2710da03
No related branches found
No related tags found
No related merge requests found
...@@ -173,7 +173,7 @@ array(string) split(string data) ...@@ -173,7 +173,7 @@ array(string) split(string data)
if(data[pos]=='\\') pos++; if(data[pos]=='\\') pos++;
int end=search(data, "'", pos+1)+1; int end=search(data, "'", pos+1)+1;
if(!end) if(!end)
throw( ({sprintf("Unknown token %O\n",data[pos..pos+20]) }) ); throw( ({sprintf("Unknown token %O\n",data[pos-1..pos+19]) }) );
pos=end; pos=end;
break; break;
......
...@@ -205,8 +205,10 @@ array(string) split(string data) ...@@ -205,8 +205,10 @@ array(string) split(string data)
pos++; pos++;
if(data[pos]=='\\') pos++; if(data[pos]=='\\') pos++;
int end=search(data, "'", pos)+1; int end=search(data, "'", pos)+1;
if (!end) if (!end) {
--pos;
UNKNOWN_TOKEN; UNKNOWN_TOKEN;
}
pos=end; pos=end;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment