Skip to content

Update tree-sitter-solidity grammar to v1.2.13 - #624

Draft
malaverdiere wants to merge 1 commit into
mainfrom
grammar-update/solidity/v1.2.13
Draft

Update tree-sitter-solidity grammar to v1.2.13#624
malaverdiere wants to merge 1 commit into
mainfrom
grammar-update/solidity/v1.2.13

Conversation

@malaverdiere

@malaverdiere malaverdiere commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Automated grammar update for solidity.

Corpus snapshots were auto-regenerated. Please review the parse-tree changes below — especially any :error (error-recovery) cases, which tree-sitter test --update does not touch automatically.

⚠️ The fix-semgrep-grammar skill patched the extension grammar and/or its tests for this bump (test-lang failed on the raw bump, typically a mechanical upstream CST rename). Scrutinize those changes in the diff.

Corpus snapshot diff
diff --git a/lang/semgrep-grammars/src/semgrep-solidity/test/corpus/semgrep.txt b/lang/semgrep-grammars/src/semgrep-solidity/test/corpus/semgrep.txt
index e9e09a2..c1d174a 100644
--- a/lang/semgrep-grammars/src/semgrep-solidity/test/corpus/semgrep.txt
+++ b/lang/semgrep-grammars/src/semgrep-solidity/test/corpus/semgrep.txt
@@ -43,7 +43,11 @@ for(...) {
 ---
 
 (source_file
-  (for_statement (ellipsis) (block_statement)))
+  (statement
+    (for_statement
+      (ellipsis)
+      (statement
+        (block_statement)))))
 
 =====================================
 Constructor pattern
@@ -57,8 +61,9 @@ constructor (...) {
         (parameter
           (ellipsis))
         (function_body
-          (expression_statement
-            (ellipsis)))))
+          (statement
+            (expression_statement
+              (ellipsis))))))
 
 =====================================
 Modifier pattern
@@ -74,8 +79,9 @@ modifier $M(...) {
         (parameter
           (ellipsis))
         (function_body
-          (expression_statement
-            (ellipsis)))))
+          (statement
+            (expression_statement
+              (ellipsis))))))
 
 =====================================
 Inheritance ellipsis pattern
@@ -107,7 +113,8 @@ enum $X {
 (source_file
       (enum_declaration
         (identifier)
-        (ellipsis)))
+        (enum_body
+          (ellipsis))))
 
 =====================================
 Event pattern
@@ -119,5 +126,5 @@ event $EV(...);
 (source_file
       (event_definition
         (identifier)
-        (event_paramater
+        (event_parameter
           (ellipsis))))
test-lang output (tail)
test-lang solidity exits 0 after fix-semgrep-grammar adapted the extension grammar (4/15 iterations).

Companion PRs:

Relates to LANG-207 but does NOT close it.

@malaverdiere
malaverdiere requested a review from a team as a code owner July 10, 2026 02:01
@malaverdiere malaverdiere added the agent-adapted-tests An agent adapted test expectations for this grammar bump label Jul 10, 2026
@malaverdiere
malaverdiere requested a review from liukatkat July 10, 2026 02:01
@malaverdiere malaverdiere added the agent-adapted-tests An agent adapted test expectations for this grammar bump label Jul 10, 2026
@malaverdiere

Copy link
Copy Markdown
Contributor Author

@malaverdiere

Copy link
Copy Markdown
Contributor Author

Downstream integration complete and compiles.

Draft proprietary PR: https://github.com/semgrep/semgrep-proprietary/pull/6721

  • Submodule bumped to grammar-update/solidity/v1.2.13 (3fcae06, ocaml-tree-sitter a5df35a)
  • Parse_solidity_tree_sitter.ml adapted to the new CST
  • Minimal parsing tests added for transient storage, layout specifiers, Yul hex strings, using … global, and named call arguments
  • Verified locally: dune build OSS/languages/solidity/generic succeeds

@malaverdiere
malaverdiere marked this pull request as draft July 10, 2026 18:10
@malaverdiere
malaverdiere requested review from brandonspark and removed request for liukatkat July 14, 2026 16:36
@malaverdiere malaverdiere self-assigned this Jul 14, 2026
@@ -98,7 +97,7 @@ module.exports = grammar(base_grammar, {
},

// typo on name in the original grammar so we must copy the typo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can remove this comment now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-adapted-tests An agent adapted test expectations for this grammar bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants