Repository navigation
fix(mcpx): delimiter scanner — fix the 9 remaining heuristic false-positive shapes (#3334) - #3339
Conversation
…sitive shapes (#3334) new operand keyword; class heritage object literal no longer consumes the body frame; debugger/break/continue newline cleanup scoped to its own statement; spread token tracked across trivia; line-break-pending survives comments; \u{...}/\uXXXX identifier escapes consumed as identifier chars; narrow TypeScript instantiation-expression recognition (primitive/capitalised type names, lowercase generics pinned as a blind spot in code); #private names never keyword-classified; import/export as object property names no longer activate module-declaration state. Regression test per shape; division controls unchanged.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27c8ea3051
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Fixes #3334 — all 9 remaining heuristic false-positive shapes in
checkSyntaxAndDelimiters(pkgs/mcpx/internal/scripting/validator.go), each with a regression test inTestValidationRegexLiteralsAreOpaque:newoperand —newadded to the expression keywords:new /a+/.constructor("x")opens the regex instead of reading the slash as division.{inside a class heritage expression at expression position (or nested in one) is tracked viaheritageBraceDepthand no longer consumes the pending body frame; operand closers (>,),]) still read as the body (class C<T> {},extends mixin() {}— the former caught as a regression during this work and covered by the existing test).;), sofunction(a = () => {debugger\n}) {} / 2keeps the outer frame..tokens (dotRun), so{... /*c*/ {} / 2}classifies the brace as the spread operand even with a comment intervening.lineBreakPending:n\n/*comment*/++ /a+/reads++as a prefix.\u{61}and\u0061are consumed as identifier characters (neutral placeholder, so an escaped spelling never forms a keyword); their braces are not delimiters.looksLikeInstantiation): a balanced, type-shaped<...>after an operand containing a primitive or capitalised type name, followed by an operand-follower token, completes the operand at>. Lowercase-only generics (f<foo> / 2) are documented in code as a pinned blind spot — locally indistinguishable from a relational chain.#nameis an operand fragment and every keyword guard now also excludeslastIdentPrev == '#'(mirroring the member-access.guard):this.#return / 2divides.import/export— the module-declaration activation now applies the same next-token property guard as function/class (:,,,},)), so{ import: "foo"\n / 2 }no longer marks the string as a module specifier.Verification:
go test ./internal/scripting/ -count=1passes on the laptop (all 105TestValidationRegexLiteralsAreOpaquesubtests incl. the 12 new ones, plus the invalid-shape controls); division controls (a / b / c,x /= 2, unclosed delimiter/string after division) unchanged.gofmtclean.Queue task 5015 (lane D). Cross-repo note: mcpx also lives in dezren39/nix — this scanner file's nix counterpart should be checked by the follow-up route if it carries the same validator; this PR is code-only per the task packet's scope.
Need help on this PR? Tag
@codesmith-botwith what you need.