For example, we could use it to show more error messages.
When using commas, non-methods (such as string literals) in the method zone (suggest template call syntax if similar name, or not using commas)
When several subsequent identifiers are found in statement position (suggest string literal or single name)
Heuristic to parse unbalanced tokens in method position
When using semicolons after statements
An option is also to have a secondary parser that accepts a broader syntax and logs error on encountering syntax that diverges with the main parser. We would call the secondary parser when finding syntax errors in the file. This way, we keep the "happy path" fast, while making the "sad path" more informative if a bit slower.
For example, we could use it to show more error messages.
An option is also to have a secondary parser that accepts a broader syntax and logs error on encountering syntax that diverges with the main parser. We would call the secondary parser when finding syntax errors in the file. This way, we keep the "happy path" fast, while making the "sad path" more informative if a bit slower.