Module parse

Source
Expand description

Parsing and AST types.

The entrypoint is to invoke parse_kdl_script which is implicitly handled by Compiler::compile_path or Compiler::compile_string and will produce a ParsedProgram.

Things like name resolution are handled by the type checker.

Structs§

AliasDecl
A transparent type alias.
AttrAligned
An attribute to passthrough to the target language.
AttrPacked
An attribute declaring this type should be packed (remove padding/align).
AttrPassthrough
An attribute to passthrough to the target language.
AttrRepr
CallExpr
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
CtorExpr
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
EnumDecl
A c-like enum decl.
EnumVariant
A variant of an EnumDecl.
FuncDecl
A function declaration
Ident
A string that may refer to another item like a type of function
IntExpr
An integer expression (literal)
KdlScriptParseError
An error that occured during parsing
LetStmt
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
LiteralExpr
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
ParsedProgram
A Parsed KDLScript program
PathExpr
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
PrintStmt
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
PunBlock
A block for a PunDecl.
PunDecl
A type pun between different languages.
PunEnv
The environment required to resolve a PunSelector.
ReturnStmt
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
StructDecl
A struct decl.
TaggedDecl
A tagged union (rust-like enum).
TaggedVariant
A variant of a TaggedDecl.
TypedVar
A (name, type) pair that occurs in many places like field/arg decls.
UnionDecl
An untagged union decl.

Enums§

Attr
An attribute that can be hung off a function or type.
Expr
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
LangRepr
Literal
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
PunSelector
A selector for a PunBlock
Repr
Stmt
All of this gunk is only used for function bodies, which only exist in the meme feature=eval mode.
TyDecl
A Type declaration
Tydent
A type “name” (which may be structural like [u32; 4]).

Functions§

parse_kdl_script
Parse a KdlScript program!

Type Aliases§

StableMap