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

Commit 372d5e6

Browse files
committed
Support enum constants via :.
1 parent d7a39a1 commit 372d5e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,12 @@ attribute node_symbol = node => symbol = (source-text node), source_n
242242
node @this.constants
243243
attr (@this.constants) pop_symbol = "."
244244
edge def -> @this.constants
245+
246+
; allow A.X field accesses to resolve constants
247+
node def__typeof
248+
attr (def__typeof) pop_symbol = ":"
249+
edge def -> def__typeof
250+
edge def__typeof -> @this.constants
245251
}
246252

247253
(enum_declaration (enum_body (enum_constant name: (_) @name))) @this {

0 commit comments

Comments
 (0)