Node¶
An AST node.
Public Functions¶
clone¶
Used to clone the node with certain updated properties during AST transformation.
fun val clone(
src_info': (SrcInfo val | None val) = reference,
new_children': (ReadSeq[Node val] val | None val) = reference,
update_map': (HashMap[Node val, Node val, HashIs[Node val] val] val | None val) = reference,
annotation': (NodeWith[Annotation val] val | None val) = reference,
doc_strings': (Array[NodeWith[DocString val] val] val | None val) = reference,
pre_trivia': (Array[NodeWith[Trivia val] val] val | None val) = reference,
post_trivia': (Array[NodeWith[Trivia val] val] val | None val) = reference,
ast_type': (AstType val | None val) = reference,
scope_index': (USize val | None val) = reference)
: Node val
Parameters¶
- src_info': (SrcInfo val | None val) = reference
- new_children': (ReadSeq[Node val] val | None val) = reference
- update_map': (HashMap[Node val, Node val, HashIs[Node val] val] val | None val) = reference
- annotation': (NodeWith[Annotation val] val | None val) = reference
- doc_strings': (Array[NodeWith[DocString val] val] val | None val) = reference
- pre_trivia': (Array[NodeWith[Trivia val] val] val | None val) = reference
- post_trivia': (Array[NodeWith[Trivia val] val] val | None val) = reference
- ast_type': (AstType val | None val) = reference
- scope_index': (USize val | None val) = reference
Returns¶
- Node val
name¶
An informative identifier for the kind of data the node stores.
Returns¶
- String val
src_info¶
Source location information.
Returns¶
- SrcInfo val
children¶
Returns¶
annotation¶
Returns¶
- (NodeWith[Annotation val] val | None val)
doc_strings¶
Returns¶
pre_trivia¶
Returns¶
post_trivia¶
Returns¶
ast_type¶
The resolved type of the node.
Returns¶
scope_index¶
Returns¶
get_json¶
Get a JSON representation of the node.
Returns¶
- Object ref
map[D: NodeData val]¶
fun box map[D: NodeData val](
seq: Array[NodeWith[D] val] val,
updates: HashMap[Node val, Node val, HashIs[Node val] val] val)
: Array[NodeWith[D] val] val
Parameters¶
Returns¶
child_ref¶
fun box child_ref(
child: Node val)
: (Object box | Sequence box | String box |
I128 val | F64 val | Bool val |
Null val)
Parameters¶
- child: Node val
Returns¶
child_refs¶
fun box child_refs(
childs: ReadSeq[Node val] val)
: (Object box | Sequence box | String box |
I128 val | F64 val | Bool val |
Null val)
Parameters¶
Returns¶
string¶
Returns¶
- String iso^