-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathjavascript.jsx.scm
101 lines (89 loc) · 2.23 KB
/
javascript.jsx.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
;;!! <foo>bar</foo>
;;! ^^^^^^^^^^^^^^
;;! ###
;;! ***
(
(jsx_element) @xmlElement @interior @interior.domain
(#child-range! @interior 0 -1 true true)
)
(
(jsx_element) @xmlElement.iteration
(#child-range! @xmlElement.iteration 0 -1 true true)
)
;;!! <foo>bar</foo>
;;! ***
(
(jsx_element) @xmlStartTag.iteration @xmlEndTag.iteration @xmlBothTags.iteration
(#child-range! @xmlStartTag.iteration 0 -1 true true)
(#child-range! @xmlEndTag.iteration 0 -1 true true)
(#child-range! @xmlBothTags.iteration 0 -1 true true)
)
;;!! <foo>bar</foo>
;;! ^^^^^---------
(jsx_element
(jsx_opening_element) @xmlStartTag @xmlBothTags
(#allow-multiple! @xmlBothTags)
) @_.domain
;;!! <foo>bar</foo>
;;! --------^^^^^^
(jsx_element
(jsx_closing_element) @xmlEndTag @xmlBothTags
(#allow-multiple! @xmlBothTags)
) @_.domain
;; Defines `name` scope for JSX fragment opening element
;;!! <></>
;;! {}
;;! --
(jsx_opening_element
"<" @name.start.endOf
.
">" @name.end.startOf
) @_.domain
;; Defines `name` scope for JSX fragment closing element
;;!! <></>
;;! {}
;;! ---
(jsx_closing_element
"</" @name.start.endOf
.
">" @name.end.startOf
) @_.domain
;;!! <foo/>
(jsx_self_closing_element) @xmlElement
;;!! <aaa bbb="ccc" />
;;! ^^^^^^^^^
(jsx_attribute) @attribute
;;!! <aaa bbb="ccc" />
;;! ^^^
(jsx_attribute
(property_identifier) @collectionKey
(_)? @_.trailing.startOf
) @_.domain
;;!! <aaa bbb="ccc" />
;;! ^^^^^
;;! xxxxxx
;;! ---------
(jsx_attribute
(_) @_.leading.endOf
(_) @value
) @_.domain
;;!! <aaa />
;;! ^^^^
(jsx_self_closing_element
"<" @attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf
"/>" @attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf
)
;;!! <aaa></aaa>
;;! ^^^
(jsx_opening_element
"<" @attribute.iteration.start.endOf @collectionKey.iteration.start.endOf @value.iteration.start.endOf
">" @attribute.iteration.end.startOf @collectionKey.iteration.end.startOf @value.iteration.end.startOf
)
;;!! <div>text</div>
;;! ^^^^
;;!! <div>({})</div>
;;! ^^^^
(
(jsx_element) @textFragment
(#child-range! @textFragment 0 -1 true true)
)