NavigateAST
Utility functions to go from typed to untyped ASTs
Value members
Concrete methods
The reverse path from any node in from
to the node that closest encloses span
,
or Nil
if no such path exists. If a non-empty path is returned it starts with
the node closest enclosing span
and ends with one of the nodes in from
.
The reverse path from any node in from
to the node that closest encloses span
,
or Nil
if no such path exists. If a non-empty path is returned it starts with
the node closest enclosing span
and ends with one of the nodes in from
.
- Value parameters:
- skipZeroExtent
If true, skip over zero-extent nodes in the search. These nodes do not correspond to code the user wrote since their start and end point are the same, so this is useful when trying to reconcile nodes with source code.
The untyped tree corresponding to typed tree tree
in the compilation
unit specified by ctx
The untyped tree corresponding to typed tree tree
in the compilation
unit specified by ctx
The reverse path of untyped trees starting with a tree that closest matches
tree
and ending in the untyped tree at the root of the compilation unit
specified by ctx
.
The reverse path of untyped trees starting with a tree that closest matches
tree
and ending in the untyped tree at the root of the compilation unit
specified by ctx
.
- Value parameters:
- exactMatch
If
true
, the path must start with a node that exactly matchestree
, orNil
is returned. Iffalse
the path might start with a node enclosing the logical position oftree
. Note: A complication concerns member definitions. ValDefs and DefDefs have after desugaring a position that spans just the name of the symbol being defined and nothing else. So we look instead for an untyped tree approximating the envelope of the definition, and declare success if we find another DefTree.