Expand description
Pipelined Language AST
Abstract Syntax Tree for the first part of PRQL compiler. It can represent basic expressions, lists, pipelines, function calls & definitions, variable declarations and more.
The central struct here is Expr and its ExprKind.
Top-level construct is a list of statements Vec<Stmt>
.
Structs§
- Annotation
- Binary
Expr - Expr
- Expr is anything that has a value and thus a type. Most of these can contain other Expr themselves; literals should be ExprKind::Literal.
- Func
- Function called with possibly missing positional arguments. May also contain environment that is needed to evaluate the body.
- Func
Call - Function call.
- Func
Param - Ident
- A name. Generally columns, tables, functions, variables. This is glorified way of writing a “vec with at least one element”.
- Import
Def - Lineage
- Represents the object that is manipulated by the pipeline transforms. Similar to a view in a database or a data frame.
- Lineage
Input - Module
Def - Query
Def - Stmt
- Transform
Call - FuncCall with better typing. Returns the modified table.
- TypeDef
- Unary
Expr - Value
AndUnit - VarDef
Enums§
- BinOp
- Expr
Kind - Join
Side - Lineage
Column - Literal
- Stmt
Kind - Table
Extern Ref - A reference to a table that is not in scope of this query.
- Transform
Kind - TyOr
Expr - An expression that may have already been converted to a type.
- UnOp
Traits§
Functions§
- fold_
column_ sort - fold_
column_ sorts - fold_
expr_ kind - fold_
func - fold_
func_ call - fold_
func_ param - fold_
interpolate_ item - fold_
optional_ box - fold_
range - fold_
stmt_ kind - fold_
switch_ case - fold_
transform_ call - fold_
transform_ kind - fold_
type - fold_
type_ opt - fold_
var_ def - fold_
window - maybe_
binop - new_
binop - print_
mem_ sizes