feat(kitchen): warn when an alias written after a blank loses its quantity #320
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!320
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/alias-after-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?
Summary
Since #303 an alias is glued to the colon, so
@salt: fine{2 g}reads as the baresaltthen text, and the quantity silently drops out of the shopping list and nutrition (pre-release audit 1.6, finding H1). Option kept: a warning with a fix, no grammar change, so nothing to carry over totree-sitter-gram.ALIAS_AFTER_BLANKwarning (data: { name, alias, suggestion }) on a bare ingredient or cookware followed by: alias{…}, multi-word names included (@dry white wine: wine{10 ml}). It is raised only when the glued form parses as that ingredient with that alias, so its fix is always safe: the fuzzer found braces that are a parse error once glued (regression infuzz/regressions/).Glue the alias to the colon: @salt:fine{2 g}), so the LSP Quick Fix andgram check --fixapply it; a second pass changes nothing.([\w][\w\s]*)); plist regenerated; newtextmate-alias.test.ts.warn-029-alias-after-blank;conformance:updatechanged nothing else.ALIAS_AFTER_BLANKsection inwarnings.mdx, #303 paragraphs ofingredients.mdxandcookware.mdx(en + fr),llms-full.txt, and the importer's prompt. Changesetparser-alias-no-leading-blankcompleted (kitchen and modules minor).Guard rails:
bun run fuzz --iterations 50000found one signature,format-preserves-meaningon CR-only line endings (@Flourvs@&flour). The same input fails onmainand ondev/1.6, so it is not this PR's; it will be fixed on its own branch frommain.bun run --cwd audit audit: 128 flags and 10 infos, as before.Type of change
Quality checklist
bun run lint:fix)bun run typecheck)bun test)bun run conformance)bun run change)bun run build)