Misplaced Block
AST due to syntax error
#381
Labels
area:soft-parser
SoftParser
type:enhancement
Enhances an existing feature by extending its functionality
Overview
The above code has following missing syntax:
It will still produce the correct go-to-definition results:
And the
Block
still gets parsed as expected, i.e., as a child of theFunction
's AST:Function
FunctionSignature
Block
Issue
An error in the return signature
->
(removed>
) causes theBlock
to be parsed as a sibling of theFunction
AST.Function
FunctionSignature
Block
This means that the
Block
is no longer within the scope of theFunction
, causing the function parameterparam
inaccessible to theBlock
.Expected
The first occurring
Block
should always be parsed a child of the parent expecting a block (while
,for
etc), for all syntax errors. The parent in this case is theFunction
AST.The text was updated successfully, but these errors were encountered: