Repository navigation
fix(parser): parse a block line starting with an operator as its own line - #1007
Merged
huydo862003 merged 2 commits intoOct 19, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
huydo862003
approved these changes
Oct 19, 2026
huydo862003
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Inside a
{ }block body, a line that starts with an operator that can start an expression (-,+,!) is now parsed as its own line instead of the rest of the line above. Inside()and[], and outside a block, an expression still continues across the newline as before.So this Records block, which failed with "Records can only contain simple values" because
-2, 7was read as5 - 2, 7, now exports both rows:The check sits next to the existing rule in
expression_bpthat stops(at the start of a line. It only looks at the innermost context, so(1followed by- 2)on the next line is still one expression, and a short-formRef: users.idfollowed by< posts.user_idon the next line still parses as one ref (the parser fuzz tests generate that form).Issue
Closes #1006
Lasting Changes (Technical)
Parser.expression_bpbreaks before an infix operator that can also be a prefix operator when it starts a line and the innermost parsing context is a block expression.parser/expression:1/+ 2/+ 3on three lines was one expression and is now three. This snapshot pinned the old behaviour on purpose, so please check you're happy to change it.parser/call_expression:-2()after1 ** 2 + 3 () ()is now its own statement.validator/wrong_table_partial_injection_syntax:!common,+commonand-commonwere one statement with one error and are now three, each with its own column errors.-in a block is its own expression; an operator line inside parentheses still continues; a short-form ref still continues onto a line starting with<; a Records row starting with a negative number after another row.Checklist
Please check directly on the box once each of these are done
dbml-homepage/static/llms.txt(if docs/features changed) (not needed)Tests:
dbml-parse2047 passed,dbml-core422 passed (the same count as onmaster). The new block-body and Records tests fail withparser.tsatmaster; the parentheses and ref tests pass on both, since they guard what must not change. A few fuzz tests sometimes hit their 5-second timeout here; the two I checked, "should handle source updates without crashing" and "should produce tables with non-empty names", time out onmastertoo (in 4 of 6 runs), so it isn't from this change. ESLint andtsc --noEmitare clean on the changed files apart from two unused imports already indata.test.ts.