fix(cli): report a syntax error in the recipe file instead of an empty recipe #253
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!253
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pipeline-entry-parse-error"
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?
Since
@useresolution was wired intorunPipeline(a221da94), a syntax error in the recipe file itself became aMODULE_PARSE_ERRORdiagnostic of the module graph instead of an exception. Every command that reads a recipe (view,export,print,build,plan,shop,scale,cook) then showed an empty recipe and exited 0; onlygram checkreported the error.runPipelinenow parses the entry file again when the graph reports a parse error for it, and throws the parser's ownGramParseError(same asrunPipelineFromSource). A syntax error in an imported module stays a diagnostic.gram checkstill reports one error, on its line.gram buildstops at the first invalid file again (as beforea221da94) instead of emitting an empty JSON for it.Tests:
tests/pipeline-parse-error.test.ts(entry throws, imported module stays a diagnostic, check unchanged). Patch changeset included.