Expand description
A simple parser, AST and prettyprinter for a textual representation of rain
programs
Modules§
- ast
- An abstract syntax tree for
rain
programs - builder
- AST-to-
rain
-IR conversion and related utilities - symbol_
table - A simple symbol table struct, used to build a rain AST into a rain IR graph
Functions§
- defeq
- Parse an equality separator, optionally preceded by whitespace
- parse_
atom - Parse an atomic
rain
expression Does not accept whitespace before the expression, and does not consume whitespace after it. - parse_
binary_ logical_ op - Parse a binary logical operation
- parse_
bool - Parse a boolean
- parse_
bool_ type - Parse the Boolean type
- parse_
comment - Parse a
rain
comment. TODO: distinguish documentation comments, and don’t ignore those - parse_
expr - Parse a
rain
expression, which is either an atom or an application of them Accepts whitespace before the expression - parse_
gamma - Parse a gamma node, consuming all whitespace before it
- parse_
ident - Parse a
rain
identifier, which is composed of any non-special character. Does not accept whitespace before the identifier, and does not consume whitespace after it. - parse_
lambda - Parse a lambda function, consuming all whitespace before it
- parse_
logical_ op - Parse a logical operation
- parse_
multi_ comment - Parse a multi line
rain
comment - parse_
natural - Parse a natural number
- parse_
opt_ ident - Parse an optional ident
- parse_
parametrized - Parse a parametrized expression
- parse_
path - Parse a
rain
path. Does not accept whitespace before the path and does not consume whitespace after it. - parse_
pattern - Parse a pattern for assignment Accepts whitespace before the pattern
- parse_
pattern_ match - Parse a pattern match
- parse_
pattern_ matches - Parse a set of pattern matches
- parse_
phi - Parse a phi node, consuming all whitespace beforeit
- parse_
pi - Parse a pi type, consuming all whitespace before it
- parse_
scope - Parse a scope, consuming all whitespace before it
- parse_
simple_ assignment - Parse a simple assignment. Accepts whitespace before it
- parse_
single_ comment - Parse a single line
rain
comment - parse_
statement - Parse a
let
-statement - parse_
type_ arrow - Parse a function type arrow
- parse_
type_ bound - Parse a type bound
- parse_
typed_ args - Parse a list of typed arguments
- parse_
typed_ idents - Parse a list of typed identifiers
- parse_
unary_ logical_ op - Parse a unary logical operation
- path_
separator - Parse a path separator
- terminator
- Parse a terminator, optionally preceded by whitespace
- whitespace
- Parse whitespace, including ignored comments. Returns the count of comments.