Skip to content

Commit 196e2c2

Browse files
committed
fixed a few error positions for invalid chars
1 parent 86db8f8 commit 196e2c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hscript/Parser.hx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ class Parser {
148148
}
149149

150150
public function invalidChar(c) {
151-
error(EInvalidChar(c), readPos-1, readPos-1);
151+
var pos = currentPos - 1;
152+
error(EInvalidChar(c), pos, pos);
152153
}
153154

154155
function initParser( origin, pos ) {
@@ -1597,6 +1598,7 @@ class Parser {
15971598
id += String.fromCharCode(char);
15981599
}
15991600
}
1601+
readPos--;
16001602
invalidChar(char);
16011603
case '#'.code:
16021604
char = readChar();
@@ -1611,6 +1613,7 @@ class Parser {
16111613
id += String.fromCharCode(char);
16121614
}
16131615
}
1616+
readPos--;
16141617
invalidChar(char);
16151618
default:
16161619
if( ops[char] ) {

0 commit comments

Comments
 (0)