Skip to content

Commit

Permalink
Adds jsx_fragment
Browse files Browse the repository at this point in the history
Co-Authored-By: Rob Rix <[email protected]>
  • Loading branch information
BekaValentine and robrix committed Oct 31, 2023
1 parent a9b8b05 commit 12ff224
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions languages/tree-sitter-stack-graphs-javascript/src/stack-graphs.tsg
Original file line number Diff line number Diff line change
Expand Up @@ -3725,6 +3725,37 @@ inherit .return_or_yield

}

(jsx_fragment)@jsx_fragment {
node @jsx_fragment.before_scope
node @jsx_fragment.after_scope

; LATER-TODO scope propagation through empty child lists
; currently unsupported by tree sitter queries
; THIS IS A HUGE HACK AND MUST BE FIXED
edge @jsx_fragment.after_scope -> @jsx_fragment.before_scope
}

(jsx_fragment
.
(_)@first_child)@jsx_fragment
{
edge @first_child.before_scope -> @jsx_fragment.before_scope
}

(jsx_fragment
(_)@left_child
.
(_)@right_child)
{
edge @right_child.before_scope -> @left_child.after_scope
}

(jsx_fragment
(_)@last_child
.)@jsx_fragment
{
edge @jsx_fragment.after_scope -> @last_child.after_scope
}



Expand Down

0 comments on commit 12ff224

Please sign in to comment.