Expand description
Precedence-climbing parser, lowering straight to the tatara-lisp quoted form.
The load-bearing design decision, made here and once: the parser’s
output IS a tatara_lisp::Sexp. There is no private blue AST that later
gets converted. That is Tenet 1 — blue source parses to tatara-lisp —
and building it any other way would make homoiconicity a conversion step
rather than an identity, which is the difference between blue’s macro
story working and merely being claimed.
The consequence to keep in view: every surface construct must have a well-defined s-expression it means. Where the mapping is not obvious it is written down in the test module, because the tests are the specification of the surface until the mechanized spec exists.
Structs§
- Comment
- A comment, and where it sat.
- Infix
- What an infix operator binds like, and what it lowers to.
- Parse
Error
Constants§
- INFIX
- The complete infix table. Precedence follows Ruby’s where Ruby has an
opinion;
|>(below) sits under everything soa |> f |> gchains without parentheses. - LOWERED_
ASSERT - Every surface keyword that BEGINS an expression.
- LOWERED_
CONCAT - The callee string interpolation lowers to.
- LOWERED_
MAP - The callee a
{...}map literal lowers to. - SURFACE_
KEYWORDS
Functions§
- comments
- Every comment in
src, with its byte span and whether it sits alone on its line. - parse_
expr - Parse a single blue expression. Convenience for tests and the REPL.
- parse_
program - Parse a blue program into a sequence of tatara-lisp forms.
- parse_
program_ spanned - Parse, keeping each top-level form’s source span.