Returns the root of the AST.
The global scope is available as ast.symbol.
Returns the diagnostics collected while preprocessing and parsing.
Whether the native resources of the parser have been released.
Releases the native resources owned by the parser.
Calling dispose more than once is allowed, the AST and the tokens of a
disposed parser must not be used.
Generates code in the given format.
the output format.
the generated code: a Uint8Array for obj, every checked
kernel with its manifest for wgsl and spirv, and a string for the
textual formats.
Returns the handle of the translation unit.
StaticparseParses the given source code.
the source code to parse and the include resolvers.
the parsed translation unit.
A parsed translation unit.
Instances are created by Parser.parse, so a
Parseris always fully parsed and every accessor is synchronous.The AST and the tokens are owned by the parser, they must not be used after the parser has been disposed.