fix(parser): end a preparation at the end of its line #170
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!170
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/preparation-single-line"
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?
Problem
The
preparationrule ofgrammar.ohm(ingredients, composite parents, cookware) read up to the next)and never stopped at a line break. One forgotten parenthesis silently swallowed the rest of the recipe:The flour got everything up to
(hotas its preparation; the bake step, its temperature and section B were gone, with no error and no warning.Fix
preparation = "(" (~(")" | nl) any)* ")": a preparation ends on its line, the same rule as the temperature notes ondev/1.5(gluedNote). An unclosed parenthesis stays in the text of the step, and what follows is read as usual.packages/parser/tests/preparation-single-line.test.ts(ingredient, bare ingredient, cookware, composite parent, closed preparations unchanged).048-preparation-single-line. Numbered 048, not 038, because 038 to 047 already exist ondev/1.5.Checks
bun test: 2498 pass,bun run conformance: 107 cases, no existing golden changed;legacy-1.3.0digests unchanged.bun run lint, typecheck of@gram-lang/parser; audit unchanged (98 flags).preparation-single-line.md(@gram-lang/parser, patch).Merging
mainintodev/1.5afterwardspackages/parser/src/grammar-content.tswill conflict: it is generated, so take either side and runbun run buildto regenerate it from the mergedgrammar.ohm(which merges cleanly).packages/formatconflicts from #168 are still to resolve (keepdev/1.5's rules 4 and 4b, rule 5 above them; keep both test blocks).preparationandgluedNotehave the same body and can become one rule.