Skip to content

Commit

Permalink
chore: support address block scope matching
Browse files Browse the repository at this point in the history
  • Loading branch information
ArArgon committed Jun 28, 2024
1 parent a7b069b commit 7954412
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lang/semgrep-grammars/src/semgrep-move-on-aptos/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ module.exports = grammar(base_grammar, {
_script_func_decl: ($, previous) => choice(previous, $.ellipsis),
_script_spec_block: ($, previous) => choice(previous, $.ellipsis),

// Address block members
_address_member: ($, previous) => choice(
previous,
$.ellipsis,
),

// Spec block members
_spec_block_member: ($, previous) => choice(
previous,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,25 @@ script {
(spec_block
(ellipsis)))
(declaration
(ellipsis))))
(ellipsis))))

=======================
Address Block
=======================

address $ADDR {
...
module $MOD { ... }
...
}
---

(source_file
(address_block
(identifier)
(ellipsis)
(module
(identifier)
(declaration
(ellipsis)))
(ellipsis)))
2 changes: 1 addition & 1 deletion lang/semgrep-grammars/src/tree-sitter-move-on-aptos
Submodule tree-sitter-move-on-aptos updated 3 files
+2 −1 grammar.js
+23 −19 src/grammar.json
+45,095 −45,064 src/parser.c

0 comments on commit 7954412

Please sign in to comment.