fix(parser): parse a document that ends with blank lines only #212
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!212
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/parser-blank-source"
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?
Closes #199.
Recipe = Frontmatter? UseBlock? Content?accepted no blank line with nothing after it, sogetAST("\n")threw. SinceformatGram("")returns"\n", a new empty.gramfile showed a syntax error after its first save. A frontmatter or@uselines followed by a blank line and nothing else failed the same way.Recipe = Frontmatter? UseBlock? Content? nl*(the semantic action takes and ignores the extra argument).055-blank-lines-only(frontmatter + blank lines → empty recipe), so the Rust port inherits it.fuzz/regressions/199-*.gramholds the empty file and a frontmatter followed by a blank line.All package tests, conformance (135 + 24) and lint pass.
bun run fuzz --iterations 50000 --seed 2111373929reports one new signature ($.registry.ingredients,@e{%1.0}), which is present on main too and is unrelated: the formatter trims a zero inside what the parser reads as a unit text. It was masked by a #197 entry; to be filed as its own issue.