-
Notifications
You must be signed in to change notification settings - Fork 304
Description
When parsing Python scripts using IronPython’s parser, we observe that a single syntax error (such as a missing quote in a print() statement) sometimes causes multiple errorrx. Instead of reporting only the actual error line, the parser marks all subsequent statements as erroneous. This cascading error behavior is inconsistent and seems to occur mostly with statements involving parentheses or quotation marks (e.g., print(),write(),sys.stdout.write("Hello ") etc).
using (IronPython.Compiler.Parser parser = IronPython.Compiler.Parser.CreateParser(context, new PythonOptions()))
Observed Behavior
A single syntax error (e.g., missing quote in print("Hello)) causes error highlights on all subsequent lines.
This does not happen for all types of syntax errors.
The issue is most frequent with print() .stdout.write("Hello " ,etc statements and string literals.
Expected Behavior
Only the actual error line should be highlighted.
The parser should recover gracefully and not cascade errors to subsequent lines.