Abstract Syntax Tree for Zig source code. For Zig syntax, the root node is at nodes[0] and contains the list of sub-nodes. For Zon syntax, the root node is at nodes[0] and contains lhs as the node index of the main expression.
Functions
fn arrayInitDotTwo(tree: Ast, buffer: *[2]Node.Index, node: Node.Index) full.ArrayInit
No documentation provided.
fn arrayInitOne(tree: Ast, buffer: *[1]Node.Index, node: Node.Index) full.ArrayInit
No documentation provided.
fn containerDeclTwo(tree: Ast, buffer: *[2]Node.Index, node: Node.Index) full.ContainerDecl
No documentation provided.
fn errorOffset(tree: Ast, parse_error: Error) u32
Returns an extra offset for column and byte offset of errors that should point …
Returns an extra offset for column and byte offset of errors that should point after the token in the error message.
fn fnProtoOne(tree: Ast, buffer: *[1]Node.Index, node: Node.Index) full.FnProto
No documentation provided.
fn fnProtoSimple(tree: Ast, buffer: *[1]Node.Index, node: Node.Index) full.FnProto
No documentation provided.
fn fullArrayInit(tree: Ast, buffer: *[2]Node.Index, node: Node.Index) ?full.ArrayInit
No documentation provided.
fn fullCall(tree: Ast, buffer: *[1]Ast.Node.Index, node: Node.Index) ?full.Call
No documentation provided.
fn fullContainerDecl(tree: Ast, buffer: *[2]Ast.Node.Index, node: Node.Index) ?full.ContainerDecl
No documentation provided.
fn fullFnProto(tree: Ast, buffer: *[1]Ast.Node.Index, node: Node.Index) ?full.FnProto
No documentation provided.
fn fullStructInit(tree: Ast, buffer: *[2]Ast.Node.Index, node: Node.Index) ?full.StructInit
No documentation provided.
fn parse(gpa: Allocator, source: [:0]const u8, mode: Mode) Allocator.Error!Ast
Result should be freed with tree.deinit() when there are no more references to …
Result should be freed with tree.deinit() when there are no more references to any of the tokens or nodes.
fn render(tree: Ast, gpa: Allocator) RenderError![]u8
gpa
is used for allocating the resulting formatted source code, as well as fo…gpa
is used for allocating the resulting formatted source code, as well as for allocating extra stack memory if needed, because this function utilizes recursion. Note: that’s not actually true yet, see https://github.com/ziglang/zig/issues/1006. Caller owns the returned slice of bytes, allocated withgpa
.fn structInitDotTwo(tree: Ast, buffer: *[2]Node.Index, node: Node.Index) full.StructInit
No documentation provided.
fn structInitOne(tree: Ast, buffer: *[1]Node.Index, node: Node.Index) full.StructInit
No documentation provided.
fn taggedUnionTwo(tree: Ast, buffer: *[2]Node.Index, node: Node.Index) full.ContainerDecl
No documentation provided.
fn tokenLocation(self: Ast, start_offset: ByteOffset, token_index: TokenIndex) Location
No documentation provided.
fn tokensOnSameLine(tree: Ast, token1: TokenIndex, token2: TokenIndex) bool
No documentation provided.