Skip to content

fix(dart): fix regex charclasses and pipeline constructor truncation for Dart - #2129

Merged
squid-protocol merged 3 commits into
mainfrom
fix-2072-dart-extraction
Aug 22, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
fix-2072-dart-extraction

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #2072. Adds . to Dart's return-type charclass so dotted return types (like ui.BoxHeightStyle) are properly captured. Also removes the arbitrary 200-character terminator search limit for colon initializer lists in detector.py, successfully recovering constructors with large initializer lists like EditableText and _DiscreteKeyFrameSimulation._.

@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 97ff328 into main Aug 22, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the fix-2072-dart-extraction branch August 22, 2026 17:42
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dart func_start: remaining recall/precision gaps from the switch-expression-arm sweep (#2071 follow-up)

1 participant