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

Commit 80be54b

Browse files
committed
Factor out the breadcrumbs.
1 parent 63ecc75 commit 80be54b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,25 +541,26 @@ attribute node_symbol = node => symbol = (source-text node), source_n
541541
edge @stmt.after_scope -> @stmt.before_scope
542542
}
543543

544+
(for_statement) @this {
545+
edge @this.after_scope -> @this.before_scope
546+
}
547+
544548
(for_statement !init !condition !update body: (_) @body) @this {
545549
edge @body.before_scope -> @this.before_scope
546-
edge @this.after_scope -> @this.before_scope
547550
}
548551

549552
(for_statement init: (expression) @init condition: (_) @condition update: (_) @update body: (_) @body) @stmt {
550553
edge @init.lexical_scope -> @stmt.before_scope
551554
edge @condition.lexical_scope -> @stmt.before_scope
552555
edge @update.lexical_scope -> @stmt.before_scope
553556
edge @body.before_scope -> @stmt.before_scope
554-
edge @stmt.after_scope -> @stmt.before_scope
555557
}
556558

557559
(for_statement init: (local_variable_declaration) @init condition: (_) @condition update: (_) @update body: (_) @body) @stmt {
558560
edge @init.before_scope -> @stmt.before_scope
559561
edge @condition.lexical_scope -> @init.after_scope
560562
edge @update.lexical_scope -> @init.after_scope
561563
edge @body.before_scope -> @init.after_scope
562-
edge @stmt.after_scope -> @stmt.before_scope
563564
}
564565

565566
(if_statement condition: (_) @condition consequence: (_) @consequence) @stmt {

0 commit comments

Comments
 (0)