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

Commit 0119086

Browse files
committed
Subtyping.
1 parent 24eb342 commit 0119086

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,17 @@ attribute node_symbol = node => symbol = (source-text node), source_n
103103
edge def -> @class_body.defs
104104

105105
node this__expr_def
106-
node this__expr_def__typeof
106+
node @class.type
107107

108108
edge @class.lexical_scope -> this__expr_def
109109

110110
attr (this__expr_def) pop_symbol = "this", source_node = @class, empty_source_span
111-
edge this__expr_def -> this__expr_def__typeof
111+
edge this__expr_def -> @class.type
112112

113-
attr (this__expr_def__typeof) pop_symbol = ":"
113+
attr (@class.type) pop_symbol = ":"
114114

115-
edge this__expr_def__typeof -> ref
115+
edge @class.type -> ref
116+
attr (@class.type -> ref) precedence = 1
116117
}
117118

118119
(class_declaration
@@ -137,6 +138,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
137138
attr (super__expr_def__typeof) pop_symbol = ":"
138139

139140
edge super__expr_def__typeof -> ref
141+
edge @class.type -> ref
140142
}
141143

142144
(class_body) @class_body {

0 commit comments

Comments
 (0)