fix(parser): read a colon followed by a blank as punctuation, not an alias #303
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!303
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/parser-alias-no-leading-blank"
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?
Fixes #273.
alias = ":" refNameaccepted an alias name starting with a blank, so a:written as punctuation after a bare mention read the rest of the line as its alias, and that text vanished from the step with no message (Heat the #pan: then add oil.→ cookwarepan, alias"then add oil.").alias = ":" ~sp refName. The alias starts right after the colon, with no blank (@dry white wine:wine{10ml},#cast iron skillet:skillet{}unchanged); a colon followed by a space or a tab is text. This also covers #281 (blanks alone up to the end of the line), so the previous lookahead goes.grammar-edge-cases.test.ts, new block for #273; the #282 test that read@salt: fleur de sel.as an alias now uses the glued form. Fuzz input infuzz/regressions/273-colon-blank-alias.gram.<Since v="1.6.0" />.minorfor@gram-lang/parser(a recipe writing@salt: fleur de sel{1g}must glue the alias).Checks: 4352 tests, 0 fail; conformance 148/148 and 24/24 with no golden change; lint, deprecations:check; fuzz 50k (seed 778388986, 0 signature).
tree-sitter-gram: same rule in the scanner, branch
fix/alias-no-leading-blank(corpus 77/77, conformance 160/160, oracle 236/236 against this parser). It is tagged and pinned once@gram-lang/parser1.6.0 is published, since its oracle runs against the npm parser.