Repository navigation
fix(dart): fix regex charclasses and pipeline constructor truncation for Dart - #2129
Merged
Merged
Conversation
Contributor
This was referenced Aug 27, 2026
squid-protocol
added a commit
that referenced
this pull request
Aug 27, 2026
…-bracket poisoning, bodyless-ctor args undercount (#2311) Three confirmed, evidenced defects from #2308/#2309, found via a tri-comparison-ledger-sweep re-investigation of dart after #2072 was closed prematurely (only 2 of its 6 items were actually fixed by #2129): - func_start: `implements`/`with` can appear as an ordinary interior token in the return-type-prefix consumption loop when a match starts on an earlier mixin-name line of a multi-line class header, letting the following identifier become a phantom function name (`AutofillClient` in flutter/editable_text.dart). Added to the shared keyword-exclusion list everywhere it appears; `extends` deliberately left out (ambiguous with generic method type-parameter bounds, already confirmed unsafe to exclude in the prior investigation). - detector.py's `_dart_scan_terminator`: bare comparison operators inside a constructor's colon-initializer list (`assert(order < double.infinity)`) were mistaken for generic angle-bracket opens, permanently poisoning `depth_angle` and making the terminator scan run off the end of the file without ever finding the real `;`/`{` (`OrdinalSortKey` in flutter/semantics.dart, silently dropped from output entirely). Now only counts a `<` as a generic-open when directly attached to an identifier. - args counting: a bodyless `this.`/`super.`-forwarding constructor (`_DeleteTextAction(this.state, ...);`) read 0 args because the separate `args` regex never accepted a bare `;` terminator. Tried extending the regex directly; reverted after it broke `test_dart_args_invalid` and independently regressed zero-paren getters (`Rect get bounds { ... }`) into borrowing an unrelated inner call statement's args. Fixed instead via `args_count_override`, counting the already-`func_start`-validated parameter list directly for this one shape. Verified: dart extraction gauntlet + strict tests, full extraction suite (all languages), ruff/mypy audits, crucible_check.py (full precision + zero-dependency, full ~80-repo corpus), tree_sitter_accuracy_audit, tri_comparison_chart --ci. Golden masters re-blessed; diff traces entirely to dart's corrected structural signatures plus expected spatial-layout ripple in a handful of unrelated files. Fixes #2308, partially addresses #2309 (the class-header-vs-constructor args misattribution for generic-bounded classes remains open, tracked in that issue). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
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.
Fixes #2072. Adds
.to Dart's return-type charclass so dotted return types (likeui.BoxHeightStyle) are properly captured. Also removes the arbitrary 200-character terminator search limit for colon initializer lists indetector.py, successfully recovering constructors with large initializer lists likeEditableTextand_DiscreteKeyFrameSimulation._.