Skip to content

fix(dart): update submodule #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
[submodule "lang/semgrep-grammars/src/tree-sitter-swift"]
path = lang/semgrep-grammars/src/tree-sitter-swift
url = https://github.com/alex-pinkus/tree-sitter-swift.git
[submodule "lang/semgrep-grammars/src/tree-sitter-dart"]
path = lang/semgrep-grammars/src/tree-sitter-dart
url = https://github.com/returntocorp/tree-sitter-dart.git
[submodule "lang/semgrep-grammars/src/tree-sitter-julia"]
path = lang/semgrep-grammars/src/tree-sitter-julia
url = https://github.com/tree-sitter/tree-sitter-julia
Expand Down Expand Up @@ -135,4 +132,7 @@
url = https://github.com/camdencheek/tree-sitter-go-mod.git
[submodule "lang/semgrep-grammars/src/tree-sitter-requirements"]
path = lang/semgrep-grammars/src/tree-sitter-requirements
url = git@github.com:tree-sitter-grammars/tree-sitter-requirements.git
url = git@github.com:tree-sitter-grammars/tree-sitter-requirements.git
[submodule "lang/semgrep-grammars/src/tree-sitter-dart"]
path = lang/semgrep-grammars/src/tree-sitter-dart
url = https://github.com/UserNobody14/tree-sitter-dart.git
1 change: 1 addition & 0 deletions lang/dart/test/ok/anonymous_metavar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__SEMGREP_EXPRESSION $_
2 changes: 2 additions & 0 deletions lang/dart/test/ok/import_ellipsis.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import 'package:google_generative_ai/google_generative_ai.dart';
...
1 change: 1 addition & 0 deletions lang/dart/test/ok/metavariable_stmt.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__SEMGREP_EXPRESSION $X;
16 changes: 14 additions & 2 deletions lang/semgrep-grammars/src/semgrep-dart/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,26 @@ module.exports = grammar(base_grammar, {
program: ($, previous) =>
choice(previous, $.semgrep_expression),

semgrep_ellipsis: $ => '...',
semgrep_ellipsis: $ => prec.left(1, '...'),
semgrep_named_ellipsis: $ => /\$\.\.\.[A-Z_][A-Z_0-9]*/,
deep_ellipsis: $ => seq(
'<...', $._expression, '...>'
),

_top_level_definition: ($, previous) => choice(
previous,
$.semgrep_ellipsis,
),

semgrep_metavariable: $ => /\$[A-Z_][A-Z_0-9]*/,

// Alternate "entry point". Allows parsing a standalone expression.
semgrep_expression: ($) => seq("__SEMGREP_EXPRESSION", $._expression),
semgrep_expression: ($) => seq("__SEMGREP_EXPRESSION", $.semgrep_pattern),

semgrep_pattern: $ => choice(
$._expression,
$._statement,
),

_expression: ($, previous) => choice(
previous,
Expand Down
2 changes: 1 addition & 1 deletion lang/semgrep-grammars/src/tree-sitter-dart
Submodule tree-sitter-dart updated 90 files
+39 −0 .editorconfig
+11 −0 .gitattributes
+22 −0 .github/workflows/ci.yaml
+7 −0 .gitignore
+3 −0 .gitmodules
+71 −0 Cargo.lock
+2 −7 Cargo.toml
+2,169 −0 Dart.g
+1 −1 LICENSE
+112 −0 Makefile
+47 −0 Package.swift
+1 −1 README.md
+19 −7 binding.gyp
+16 −0 bindings/c/tree-sitter-dart.h
+11 −0 bindings/c/tree-sitter-dart.pc.in
+14 −0 bindings/go/binding.go
+15 −0 bindings/go/binding_test.go
+14 −22 bindings/node/binding.cc
+28 −0 bindings/node/index.d.ts
+3 −15 bindings/node/index.js
+5 −0 bindings/python/tree_sitter_dart/__init__.py
+1 −0 bindings/python/tree_sitter_dart/__init__.pyi
+27 −0 bindings/python/tree_sitter_dart/binding.c
+0 −0 bindings/python/tree_sitter_dart/py.typed
+4 −3 bindings/rust/build.rs
+2 −2 bindings/rust/lib.rs
+16 −0 bindings/swift/TreeSitterDart/dart.h
+5 −0 go.mod
+520 −394 grammar.js
+0 −13 index.js
+38 −6 package.json
+6 −0 pubspec.yaml
+29 −0 pyproject.toml
+122 −100 queries/highlights.scm
+92 −0 queries/tags.scm
+1 −0 queries/test.scm
+60 −0 setup.py
+0 −28 src/binding.cc
+3,273 −1,254 src/grammar.json
+6,806 −3,549 src/node-types.json
+149,992 −108,634 src/parser.c
+1 −71 src/scanner.c
+54 −0 src/tree_sitter/alloc.h
+290 −0 src/tree_sitter/array.h
+55 −13 src/tree_sitter/parser.h
+0 −0 test.dart
+87 −0 test/corpus/annotations.txt
+500 −475 test/corpus/big_tests.txt
+93 −0 test/corpus/class_modifiers.txt
+6 −2 test/corpus/comments.txt
+79 −52 test/corpus/dart.txt
+46 −47 test/corpus/declarations.txt
+94 −0 test/corpus/enhanced_enums.txt
+18 −0 test/corpus/errors.txt
+682 −389 test/corpus/expressions.txt
+101 −5 test/corpus/flutter.txt
+171 −78 test/corpus/literals.txt
+122 −66 test/corpus/more_expressions.txt
+115 −0 test/corpus/patterns.txt
+316 −0 test/corpus/records.txt
+1 −0 test/highlight/crash2.dart
+38 −0 test/highlight/functions.dart
+204 −0 test/highlight/keywords.dart
+31 −4 test/highlight/types.dart
+26 −0 test/tags/flutter.dart
+54 −0 test/tags/functions.dart
+139 −0 test/tags/keywords.dart
+58 −0 test/tags/types.dart
+5 −4 tester/pubspec.yaml
+80 −29 tester/test.dart
+ tree-sitter-dart.wasm
+3 −0 tree_sitter/.gitignore
+2 −0 tree_sitter/.pubignore
+8 −0 tree_sitter/CHANGELOG.md
+7 −0 tree_sitter/LICENSE
+16 −0 tree_sitter/Makefile
+35 −0 tree_sitter/README.md
+30 −0 tree_sitter/analysis_options.yaml
+16 −0 tree_sitter/api_config.yaml
+48 −0 tree_sitter/bin/gen_grammar.dart
+442 −0 tree_sitter/bin/gen_grammar.freezed.dart
+46 −0 tree_sitter/bin/gen_grammar.g.dart
+22 −0 tree_sitter/example/tree_sitter.dart
+2,360 −0 tree_sitter/lib/src/generated_bindings.dart
+243 −0 tree_sitter/lib/src/parser_generated_bindings.dart
+12 −0 tree_sitter/lib/src/utils.dart
+316 −0 tree_sitter/lib/tree_sitter.dart
+8 −0 tree_sitter/parser_config.yaml
+26 −0 tree_sitter/pubspec.yaml
+16 −0 tree_sitter/test/tree_sitter_test.dart