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

Commit 03872bd

Browse files
committed
Rename a bunch of identifiers.
1 parent c256b6e commit 03872bd

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

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

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ attribute node_symbol = node => symbol = (source-text node), source_n
161161
edge @param.lexical_scope -> @class.lexical_scope
162162
}
163163

164-
(type_parameter (type_identifier) @id) @this {
164+
(type_parameter (type_identifier) @name) @this {
165165
node @this.def
166166
node @this.lexical_scope
167167

168-
edge @id.lexical_scope -> @this.lexical_scope
168+
edge @name.lexical_scope -> @this.lexical_scope
169169

170-
attr (@this.def) node_definition = @id
170+
attr (@this.def) node_definition = @name
171171
}
172172

173173
(spread_parameter) @spread_param {
@@ -391,15 +391,15 @@ attribute node_symbol = node => symbol = (source-text node), source_n
391391
edge @method.defs -> @param.def
392392
}
393393

394-
(formal_parameter type: (_) @type (_) @id) @param
394+
(formal_parameter type: (_) @type (_) @name) @param
395395
{
396396
node @param.def
397397
node @param.lexical_scope
398398
node def__typeof
399399

400400
edge @type.lexical_scope -> @param.lexical_scope
401401

402-
attr (@param.def) node_definition = @id
402+
attr (@param.def) node_definition = @name
403403

404404
attr (def__typeof) pop_symbol = ":"
405405
edge def__typeof -> @type.type
@@ -520,12 +520,12 @@ attribute node_symbol = node => symbol = (source-text node), source_n
520520
edge @expr_stmt.after_scope -> @expr_stmt.before_scope
521521
}
522522

523-
(enhanced_for_statement type: (_) @type (_) @id value: (_) @value body: (_) @body) @stmt {
523+
(enhanced_for_statement type: (_) @type (_) @name value: (_) @value body: (_) @body) @stmt {
524524
edge @type.lexical_scope -> @stmt.before_scope
525525
edge @value.lexical_scope -> @stmt.before_scope
526526
node def
527527
node defs
528-
attr (def) node_definition = @id
528+
attr (def) node_definition = @name
529529
edge defs -> @stmt.before_scope
530530
edge defs -> def
531531
edge @body.before_scope -> defs
@@ -558,7 +558,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
558558
edge @alternative.before_scope -> @stmt.before_scope
559559
}
560560

561-
(labeled_statement (identifier) @id (statement) @child) @stmt {
561+
(labeled_statement (identifier) @name (statement) @child) @stmt {
562562
edge @child.before_scope -> @stmt.before_scope
563563
edge @stmt.after_scope -> @child.after_scope
564564
; FIXME: labels
@@ -643,10 +643,10 @@ attribute node_symbol = node => symbol = (source-text node), source_n
643643
edge @stmt.after_scope -> @stmt.before_scope
644644
}
645645

646-
(try_statement (catch_clause (catch_formal_parameter (catch_type) @type (_) @id) body: (_) @body)) @stmt {
646+
(try_statement (catch_clause (catch_formal_parameter (catch_type) @type (_) @name) body: (_) @body)) @stmt {
647647
node def
648648
node defs
649-
attr (def) node_definition = @id
649+
attr (def) node_definition = @name
650650
edge defs -> def
651651
edge @body.before_scope -> defs
652652
edge defs -> @stmt.before_scope
@@ -696,12 +696,12 @@ attribute node_symbol = node => symbol = (source-text node), source_n
696696
node @this.after_scope
697697
}
698698

699-
(resource type: (_) @type (_) @id value: (_) @value) @this {
699+
(resource type: (_) @type (_) @name value: (_) @value) @this {
700700
edge @type.lexical_scope -> @this.before_scope
701701
edge @value.lexical_scope -> @this.before_scope
702702

703703
node def
704-
attr (def) node_definition = @id
704+
attr (def) node_definition = @name
705705

706706
node def__typeof
707707
attr (def__typeof) pop_symbol = ":"
@@ -714,19 +714,19 @@ attribute node_symbol = node => symbol = (source-text node), source_n
714714
edge @this.after_scope -> @this.before_scope
715715
}
716716

717-
(resource . (identifier) @id .) @this {
718-
node @id.lexical_scope
719-
node @id.type
717+
(resource . (identifier) @name .) @this {
718+
node @name.lexical_scope
719+
node @name.type
720720

721721
node ref
722722
node ref__typeof
723723

724-
attr (ref) node_reference = @id
724+
attr (ref) node_reference = @name
725725

726-
edge ref -> @id.lexical_scope
727-
edge @id.lexical_scope -> @this.before_scope
726+
edge ref -> @name.lexical_scope
727+
edge @name.lexical_scope -> @this.before_scope
728728

729-
edge @id.type -> ref__typeof
729+
edge @name.type -> ref__typeof
730730

731731
attr (ref__typeof) push_symbol = ":"
732732
edge ref__typeof -> ref
@@ -739,10 +739,10 @@ attribute node_symbol = node => symbol = (source-text node), source_n
739739
edge @this.after_scope -> @this.before_scope
740740
}
741741

742-
(try_with_resources_statement (catch_clause (catch_formal_parameter (catch_type) @type (_) @id) body: (_) @body)) @stmt {
742+
(try_with_resources_statement (catch_clause (catch_formal_parameter (catch_type) @type (_) @name) body: (_) @body)) @stmt {
743743
node def
744744
node defs
745-
attr (def) node_definition = @id
745+
attr (def) node_definition = @name
746746
edge defs -> def
747747
edge @body.before_scope -> defs
748748
edge defs -> @stmt.before_scope
@@ -797,7 +797,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
797797
edge @type.lexical_scope -> @this.lexical_scope
798798
}
799799

800-
(primary_expression/identifier) @ident
800+
(primary_expression/identifier) @name
801801
{
802802
node member
803803
node implicit_this
@@ -808,12 +808,12 @@ attribute node_symbol = node => symbol = (source-text node), source_n
808808
attr (implicit_this) symbol_reference = "this", empty_source_span
809809
edge implicit_this__typeof -> implicit_this
810810
attr (implicit_this__typeof) push_symbol = ":"
811-
edge implicit_this -> @ident.lexical_scope
811+
edge implicit_this -> @name.lexical_scope
812812

813813
node ref
814-
attr (ref) node_reference = @ident
815-
edge ref -> @ident.lexical_scope
816-
attr (ref -> @ident.lexical_scope) precedence = 1
814+
attr (ref) node_reference = @name
815+
edge ref -> @name.lexical_scope
816+
attr (ref -> @name.lexical_scope) precedence = 1
817817
edge ref -> member
818818

819819
attr (member) push_symbol = "."
@@ -822,21 +822,21 @@ attribute node_symbol = node => symbol = (source-text node), source_n
822822
edge object__typeof -> implicit_this__typeof
823823

824824
node ref__typeof
825-
edge @ident.type -> ref__typeof
825+
edge @name.type -> ref__typeof
826826

827827
attr (ref__typeof) push_symbol = ":"
828828
edge ref__typeof -> ref
829829
}
830830

831831
(field_access
832832
object: (_) @object
833-
field: (identifier) @identifier) @field_access {
833+
field: (identifier) @name) @field_access {
834834
node member
835835

836836
edge @object.lexical_scope -> @field_access.lexical_scope
837837

838838
node ref
839-
attr (ref) node_reference = @identifier
839+
attr (ref) node_reference = @name
840840
edge ref -> member
841841

842842
attr (member) push_symbol = "."
@@ -897,11 +897,11 @@ attribute node_symbol = node => symbol = (source-text node), source_n
897897
edge @lhs.lexical_scope -> @this.lexical_scope
898898
}
899899

900-
(method_reference . (_) @lhs (identifier) @id) @this {
900+
(method_reference . (_) @lhs (identifier) @name) @this {
901901
node @this.member
902902

903903
node expr_ref
904-
attr (expr_ref) node_reference = @id
904+
attr (expr_ref) node_reference = @name
905905
edge expr_ref -> @this.member
906906

907907
attr (@this.member) push_symbol = "."
@@ -914,7 +914,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
914914
edge expr_ref__typeof -> expr_ref
915915
}
916916

917-
(method_reference . (identifier) @lhs (identifier) @id) @this {
917+
(method_reference . (identifier) @lhs (identifier) @name) @this {
918918
; @lhs could be a type name
919919
node ref
920920
attr (ref) node_reference = @lhs
@@ -947,10 +947,10 @@ attribute node_symbol = node => symbol = (source-text node), source_n
947947
node @expr.lexical_scope
948948
}
949949

950-
(assignment_expression left: (identifier) @ident) @this {
950+
(assignment_expression left: (identifier) @name) @this {
951951
; FIXME: can we combine this with primary_expression/identifier?
952-
node @ident.lexical_scope
953-
node @ident.type
952+
node @name.lexical_scope
953+
node @name.type
954954
node member
955955
node implicit_this
956956
node implicit_this__typeof
@@ -960,12 +960,12 @@ attribute node_symbol = node => symbol = (source-text node), source_n
960960
attr (implicit_this) symbol_reference = "this", empty_source_span
961961
edge implicit_this__typeof -> implicit_this
962962
attr (implicit_this__typeof) push_symbol = ":"
963-
edge implicit_this -> @ident.lexical_scope
963+
edge implicit_this -> @name.lexical_scope
964964

965965
node ref
966-
attr (ref) node_reference = @ident
967-
edge ref -> @ident.lexical_scope
968-
attr (ref -> @ident.lexical_scope) precedence = 1
966+
attr (ref) node_reference = @name
967+
edge ref -> @name.lexical_scope
968+
attr (ref -> @name.lexical_scope) precedence = 1
969969
edge ref -> member
970970

971971
attr (member) push_symbol = "."
@@ -974,12 +974,12 @@ attribute node_symbol = node => symbol = (source-text node), source_n
974974
edge object__typeof -> implicit_this__typeof
975975

976976
node ref__typeof
977-
edge @ident.type -> ref__typeof
977+
edge @name.type -> ref__typeof
978978

979979
attr (ref__typeof) push_symbol = ":"
980980
edge ref__typeof -> ref
981981

982-
edge @ident.lexical_scope -> @this.lexical_scope
982+
edge @name.lexical_scope -> @this.lexical_scope
983983
}
984984

985985
(assignment_expression left: (field_access) @access) @this {

0 commit comments

Comments
 (0)