Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9ea82d9
fix(dart): bump tree-sitter-dart and adapt OCaml mapper for Dart 3
AlexLaroche May 2, 2026
34ce0d7
fix(dart): improve parser fidelity for methods, strings, and construc…
AlexLaroche May 2, 2026
df0cc3a
chore(dart): drop stale segfault gate now that grammar is fixed
AlexLaroche May 2, 2026
0e9f348
chore(dart): point semgrep-dart submodule URL at fork for validation
AlexLaroche May 2, 2026
3f11846
fix(dart): adapt OCaml mapper to new CST shapes from grammar fixes
AlexLaroche May 4, 2026
ba745c7
fix(dart): adapt OCaml mapper to abstract field / external var CST sh…
AlexLaroche May 4, 2026
e284158
fix(dart): adapt OCaml mapper to label/operator identifier CST shapes
AlexLaroche May 4, 2026
b7264bb
fix(dart): map empty-statement CST to a Block
AlexLaroche May 4, 2026
7160dfe
fix(dart): map external instance field CST to a VarDef
AlexLaroche May 4, 2026
ebc4e92
fix(dart): adapt OCaml mapper for for-loop and field-initializer changes
AlexLaroche May 4, 2026
7763a04
fix(dart): adapt OCaml mapper for null-aware map key CST
AlexLaroche May 4, 2026
747b3cf
feat(dart): allow null-assertion in cascades and ffi external get/set…
AlexLaroche May 4, 2026
45984ee
feat(dart): unnamed library directive, full symbol literals, single-n…
AlexLaroche May 4, 2026
23421ce
fix(dart): adapt OCaml mapper for record-return method CST
AlexLaroche May 5, 2026
c16a3ae
fix(dart): prefer statement parse for patterns starting with stmt key…
AlexLaroche May 5, 2026
6fdd600
fix(dart): preserve uninitialized local variable declarations
AlexLaroche May 5, 2026
f156970
fix(dart): route `await` and `rethrow` patterns through stmt parse
AlexLaroche May 5, 2026
f62f585
style(dart): apply ocamlformat 0.29.0
AlexLaroche May 6, 2026
ef4d2e3
feat(dart): support typed metavariable `$X as T` and `metavariable-type`
AlexLaroche May 6, 2026
89fd621
feat(dart): bind metavariables inside string interpolations
AlexLaroche May 6, 2026
ec175d5
fix(dart): function-definition patterns match function definitions
AlexLaroche May 6, 2026
17b9fb7
test(dart): cover typed metavar, metavariable-type, string-interp met…
AlexLaroche May 6, 2026
6817d07
test(dart): cover parser bug fixes and Dart 3 grammar features
AlexLaroche May 6, 2026
95426eb
chore(dart): bump semgrep-dart submodule to a28267f for record_return…
AlexLaroche May 6, 2026
38f5f8f
test(dart): approve dart3_grammar_features parsing snapshot
AlexLaroche May 6, 2026
15c9a6f
chore(dart): point semgrep-dart submodule at canonical upstream
AlexLaroche May 8, 2026
f47427d
chore(dart): keep `.git` suffix on semgrep-dart submodule URL
AlexLaroche May 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(dart): point semgrep-dart submodule at canonical upstream
Switch the submodule URL from the AlexLaroche fork back to
returntocorp/semgrep-dart, and bump the pointer to 0202e42 (yosef's
just-merged PR #1, regenerated against UserNobody14/tree-sitter-dart
02e9bb19).

Drop the `Labe_stmt` arm from the OCaml mapper: enabling
`$.labeled_statement` was a local patch on top of the upstream grammar
snapshot and isn't on UserNobody14/tree-sitter-dart yet, so it can't
ride along with a canonical-upstream submodule pointer. Labeled
statements weren't supported on develop either, so this is not a
regression; it can be re-introduced in a follow-up once the grammar
change lands upstream.

Also add changelog entries for PR #11678.
  • Loading branch information
AlexLaroche committed May 8, 2026
commit 15c9a6faf6802b24455466fef765277c2fe55b52
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ url = https://github.com/returntocorp/semgrep-promql.git

[submodule "OSS/languages/dart/tree-sitter/semgrep-dart"]
path = languages/dart/tree-sitter/semgrep-dart
url = https://github.com/AlexLaroche/semgrep-dart.git
url = https://github.com/returntocorp/semgrep-dart

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we remove this part of the diff?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


[submodule "OSS/languages/ql/tree-sitter/semgrep-ql"]
path = languages/ql/tree-sitter/semgrep-ql
Expand Down
3 changes: 3 additions & 0 deletions changelog.d/gh-11678.added
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dart: typed metavariables (`$X as T`) and `metavariable-type`,
metavariable binding inside string interpolations, and function-definition
patterns that match Dart function definitions.
4 changes: 4 additions & 0 deletions changelog.d/gh-11678.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dart: improved parser fidelity for Dart 3 grammar features and routed
pattern parsing for statements beginning with `await`, `rethrow`, and other
statement keywords. Eliminates a large class of `PartialParsing` errors on
real-world pub.dev packages.
8 changes: 0 additions & 8 deletions languages/dart/generic/Parse_dart_tree_sitter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2962,14 +2962,6 @@ and map_statement (env : env) (x : CST.statement) : stmt list =
let tok, args = map_assertion env v1 in
let sc = (* ";" *) map_semicolon env v2 in
[ Assert (tok, args, sc) |> G.s ]
| `Labe_stmt (v1, v2, v3) ->
(* Dart's labeled_statement: `<id>: <stmt>`. The label can be the
target of `break <id>;` / `continue <id>;` from inside any
statement, not just loops. *)
let label = (* identifier *) str env v1 in
let _colon = (* ":" *) token env v2 in
let stmts = map_statement env v3 in
[ Label (label, G.stmt1 stmts) |> G.s ]
| `Empty_stmt tok ->
(* `;` — empty/null statement; emit an empty Block. *)
let _sc = (* ";" *) token env tok in
Expand Down
2 changes: 1 addition & 1 deletion languages/dart/tree-sitter/semgrep-dart
Loading