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

Commit ec078f7

Browse files
committed
Variable definitions are typed.
1 parent 7fae2ec commit ec078f7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
237237
}
238238

239239
(local_variable_declaration
240+
type: (_) @type
240241
declarator: (variable_declarator
241242
name: (_) @name
242243
)
@@ -247,6 +248,13 @@ attribute node_symbol = node => symbol = (source-text node), source_n
247248
edge @local_var.after_scope -> def
248249
edge @local_var.after_scope -> @local_var.before_scope
249250
attr (@local_var.after_scope -> @local_var.before_scope) precedence = 1
251+
252+
node def__typeof
253+
attr (def__typeof) pop_symbol = ":"
254+
255+
edge def -> def__typeof
256+
257+
edge def__typeof -> @type.value
250258
}
251259

252260
(local_variable_declaration

0 commit comments

Comments
 (0)