You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When typing code, it is normal that the syntax/grammar enters a non-correct state. For example, think of the following snippets
selecting an identifier x.<missing>
writing an if block "if "
etc.
In IntellIJ, when a parse error is encountered, the parser stops and the rest of the text will not be parsed. This leads to
semantic highlighting not working or flickering colors
errors being reported in an unexpected location
pollution of Psi-Tree makes with DUMMY-Block + Error
It is therefore necessary to define rules for the parser, that tell it how to recover from incomplete statements and expressions, such that the error will be contained in a small region of the code.
Write recover rules for the following statements, expressions and types:
package declaration statement
variable declaration statement
variable initialization statement
assignment statement
if statement
switch statement
case-clauses
struct fields
for statement (probably need to merge rules for "for" and "for ... in ..."
binary expressions
selector expression
argument list
parameter list
proc, enum, struct, union, bit_field, ...
where-clause
unclosed blocks (consume unclosed block until beginning of next block owner, I guess)
statement list (when statement list breaks, error is wrongly shown before the begin of the block)
list of procedures inside procedure group (use list with recovery)
when statement
...
The text was updated successfully, but these errors were encountered:
When typing code, it is normal that the syntax/grammar enters a non-correct state. For example, think of the following snippets
x.<missing>
In IntellIJ, when a parse error is encountered, the parser stops and the rest of the text will not be parsed. This leads to
It is therefore necessary to define rules for the parser, that tell it how to recover from incomplete statements and expressions, such that the error will be contained in a small region of the code.
Write recover rules for the following statements, expressions and types:
...
The text was updated successfully, but these errors were encountered: