Code to parse string disp a\nproc2 = get. The 1st line disp a is valid string. The 2nd line proc2=get is invalid and should return error. However, the exception I got from parser told me the error occurs at line 1. I checked the parser, and it uses \n as newline char, so it should return line 2 has error.
Grammar file: https://github.com/opencybersecurityalliance/kestrel-lang/blob/develop/src/kestrel/syntax/kestrel.lark Generated parser: kestrelParser.js.zip
Code to parse string
disp a\nproc2 = get
. The 1st linedisp a
is valid string. The 2nd lineproc2=get
is invalid and should return error. However, the exception I got from parser told me the error occurs at line 1. I checked the parser, and it uses\n
as newline char, so it should return line 2 has error.Expected: the exception should return correct line number where the error occurs.