NodeWith[D: NodeData val]¶
An AST node with specific semantic data.
Implements¶
- Node val
Constructors¶
create¶
new val create(
src_info': SrcInfo val,
children': ReadSeq[Node val] val,
data': D,
annotation': (NodeWith[Annotation val] val | None val) = reference,
doc_strings': Array[NodeWith[DocString val] val] val = array,
pre_trivia': Array[NodeWith[Trivia val] val] val = array,
post_trivia': Array[NodeWith[Trivia val] val] val = array,
ast_type': (AstType val | None val) = reference,
scope_index': (USize val | None val) = reference)
: NodeWith[D] val^
Parameters¶
- src_info': SrcInfo val
- children': ReadSeq[Node val] val
- data': D
- annotation': (NodeWith[Annotation val] val | None val) = reference
- doc_strings': Array[NodeWith[DocString val] val] val = array
- pre_trivia': Array[NodeWith[Trivia val] val] val = array
- post_trivia': Array[NodeWith[Trivia val] val] val = array
- ast_type': (AstType val | None val) = reference
- scope_index': (USize val | None val) = reference
Returns¶
- NodeWith[D] val^
from¶
new val from(
orig: NodeWith[D] val,
src_info': (SrcInfo val | None val) = reference,
children': (ReadSeq[Node val] val | None val) = reference,
data': (D | 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)
: NodeWith[D] val^
Parameters¶
- orig: NodeWith[D] val
- src_info': (SrcInfo val | None val) = reference
- children': (ReadSeq[Node val] val | None val) = reference
- data': (D | 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¶
- NodeWith[D] val^
Public Functions¶
clone¶
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¶
The kind of data that is stored in this node.
Returns¶
- String val
src_info¶
Source file information for this node.
Returns¶
- SrcInfo val
children¶
The complete list of children of this node.
Returns¶
data¶
Semantic data associated with this node. Node references in data
must
reference nodes in children
.
Returns¶
- D
doc_strings¶
Zero or more doc strings associated with this node. Must be references
to nodes in children
.
Returns¶
annotation¶
The node's annotation, if any. Must be a reference to a node in
children
.
Returns¶
- (NodeWith[Annotation val] val | None val)
pre_trivia¶
Trivia (whitespace, comments) that appears before the significant content
of this node. Likely only appears in SrcFile
. Must be references to
nodes in children
.
Returns¶
post_trivia¶
Trivia (whitespace, comments) that appears after the significant content
of this node. Must be references to nodes in children
.
Returns¶
ast_type¶
The resolved type of this node, if any.
Returns¶
scope_index¶
Returns¶
get_json¶
Get a JSON representation of the node.
Returns¶
- Object ref
string¶
Returns¶
- String iso^
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)