Expand description
Hand-written recursive-descent parser for Bynk v0.
Token grammar in spec §4. The expression parser uses one function per precedence level (§4.4). Errors carry spans and short fix-oriented messages; the parser does not currently attempt synchronisation, which means at most one parse error is reported per compilation.
Functions§
- parse
- Parse a token slice into a
CommonsAST. - parse_
unit - Parse a token slice into a
SourceUnit— either a commons or a context. - parse_
unit_ with_ recovery - Parse a token slice into a
SourceUnitwith error recovery, returning a best-effort partial AST plus the full list of parse errors and warnings. - parse_
units - Parse a token slice into all the top-level
SourceUnits in one file (v0.113, testing track slice 1b). A.bynkfile may hold more than one top-level declaration — an atomic file withcommons/contextand asuitetogether (DECISION S) — so the compiler parses aVec, not a single unit. Test-ness is a property of each declaration, not of the file.