Add a whole-file/program parser to twill-parser #45
Labels
No labels
bug
design
epic
risk
user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jacksonopp/twill#45
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
twill-parser has no entry point that parses a whole source file. stmt_parser() parses exactly one statement, and every call site (including all existing tests) only ever calls it once -- there's no repeated()-style production that consumes a sequence of top-level statements until EOF.
Discovered while working through #44 (db trait + SourceFile skeleton): twill-check's parse tracked fn needs to hand a whole file's text to twill-parser and get back a full module/program, not a single statement, so this blocks #43 (lowering the parsed AST) from doing anything real.
Scope: a program_parser (name TBD) that repeats stmt_parser() to end-of-input, returning something like Vec<Spanned<Stmt<'src>>> or a dedicated Program/Module AST node -- same one-fn-per-production, .boxed() convention as the rest of parser.rs. Snapshot-test it the same way other productions are tested.