Improve error messages from malformed Nasal hashes ( flightgear#3222 )
Minimal reproducible example here:
var foo = {
a: func() {},
var bar = func() {},
# ^^^ parseBlock does needsSemi here, and add newToken(p, TOK_SEMI)
# newToken(p, TOK_SEMI) will create a new token with line = -1
c: func() {},
};
The parser thinks here should be ;, so generats a new TOK_SEMI token,
but the line of this token must be -1,
so the solution is synchronize line with token t.
Maybe this is not the best solution, if anyone could help i would be very grateful.
And as james wrote in the email, unit test is needed for the fix patch, but i do not know where to write this, hope anyone could help me.