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§
- Alias
Decl - A transparent type alias.
- Attr
Aligned - An attribute to passthrough to the target language.
- Attr
Packed - An attribute declaring this type should be packed (remove padding/align).
- Attr
Passthrough - An attribute to passthrough to the target language.
- Attr
Repr - Call
Expr - All of this gunk is only used for function bodies, which only
exist in the meme
feature=eval
mode. - Ctor
Expr - All of this gunk is only used for function bodies, which only
exist in the meme
feature=eval
mode. - Enum
Decl - A c-like enum decl.
- Enum
Variant - A variant of an
EnumDecl
. - Func
Decl - A function declaration
- Ident
- A string that may refer to another item like a type of function
- IntExpr
- An integer expression (literal)
- KdlScript
Parse Error - 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. - Literal
Expr - All of this gunk is only used for function bodies, which only
exist in the meme
feature=eval
mode. - Parsed
Program - A Parsed KDLScript program
- Path
Expr - All of this gunk is only used for function bodies, which only
exist in the meme
feature=eval
mode. - Print
Stmt - 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
. - Return
Stmt - All of this gunk is only used for function bodies, which only
exist in the meme
feature=eval
mode. - Struct
Decl - A struct decl.
- Tagged
Decl - A tagged union (rust-like enum).
- Tagged
Variant - A variant of a
TaggedDecl
. - Typed
Var - A (name, type) pair that occurs in many places like field/arg decls.
- Union
Decl - 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. - Lang
Repr - 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!