Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit b5ea65b

Browse files
authored
Merge pull request #395 from github/class-static-blocks
Class static blocks
2 parents 3e6ad8a + 7c36737 commit b5ea65b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

languages/tree-sitter-stack-graphs-javascript/src/stack-graphs.tsg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,15 @@ inherit .containing_class_value
16931693
edge @property.pop -> @value.value
16941694
}
16951695

1696+
(class_static_block body: (_) @body) @static_block {
1697+
node @static_block.before_scope
1698+
node @static_block.after_scope
1699+
1700+
edge @body.before_scope -> @static_block.before_scope
1701+
1702+
edge @static_block.after_scope -> @static_block.before_scope
1703+
}
1704+
16961705

16971706

16981707
;; #### Statement Block

languages/tree-sitter-stack-graphs-javascript/test/base_syntax.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function foo(undefined) { }
1313
function* foo() { }
1414
class Foo {
1515
#x = null;
16+
static {}
1617
}
1718
@Foo class Bar { }
1819
@Foo.Quux class Bar { }

0 commit comments

Comments
 (0)