8
8
#![ allow( non_snake_case) ]
9
9
10
10
use oxc_allocator:: { Box , Vec } ;
11
- use oxc_ast_macros:: visited_node ;
11
+ use oxc_ast_macros:: ast ;
12
12
use oxc_span:: { Atom , Span } ;
13
13
#[ cfg( feature = "serialize" ) ]
14
14
use serde:: Serialize ;
@@ -20,7 +20,7 @@ use super::{inherit_variants, js::*, literal::*, ts::*};
20
20
// 1.2 JSX Elements
21
21
22
22
/// JSX Element
23
- #[ visited_node ]
23
+ #[ ast ( visit ) ]
24
24
#[ derive( Debug , Hash ) ]
25
25
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
26
26
#[ cfg_attr( feature = "serialize" , serde( tag = "type" , rename_all = "camelCase" ) ) ]
@@ -33,7 +33,7 @@ pub struct JSXElement<'a> {
33
33
}
34
34
35
35
/// JSX Opening Element
36
- #[ visited_node ]
36
+ #[ ast ( visit ) ]
37
37
#[ derive( Debug , Hash ) ]
38
38
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
39
39
#[ cfg_attr( feature = "serialize" , serde( tag = "type" , rename_all = "camelCase" ) ) ]
@@ -47,7 +47,7 @@ pub struct JSXOpeningElement<'a> {
47
47
}
48
48
49
49
/// JSX Closing Element
50
- #[ visited_node ]
50
+ #[ ast ( visit ) ]
51
51
#[ derive( Debug , Hash ) ]
52
52
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
53
53
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -58,7 +58,7 @@ pub struct JSXClosingElement<'a> {
58
58
}
59
59
60
60
/// JSX Fragment
61
- #[ visited_node ]
61
+ #[ ast ( visit ) ]
62
62
#[ derive( Debug , Hash ) ]
63
63
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
64
64
#[ cfg_attr( feature = "serialize" , serde( tag = "type" , rename_all = "camelCase" ) ) ]
@@ -87,7 +87,7 @@ pub struct JSXClosingFragment {
87
87
}
88
88
89
89
/// JSX Element Name
90
- #[ visited_node ]
90
+ #[ ast ( visit ) ]
91
91
#[ derive( Debug , Hash ) ]
92
92
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
93
93
#[ cfg_attr( feature = "serialize" , serde( untagged) ) ]
@@ -101,7 +101,7 @@ pub enum JSXElementName<'a> {
101
101
}
102
102
103
103
/// JSX Namespaced Name
104
- #[ visited_node ]
104
+ #[ ast ( visit ) ]
105
105
#[ derive( Debug , Hash ) ]
106
106
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
107
107
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -113,7 +113,7 @@ pub struct JSXNamespacedName<'a> {
113
113
}
114
114
115
115
/// JSX Member Expression
116
- #[ visited_node ]
116
+ #[ ast ( visit ) ]
117
117
#[ derive( Debug , Hash ) ]
118
118
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
119
119
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -124,7 +124,7 @@ pub struct JSXMemberExpression<'a> {
124
124
pub property : JSXIdentifier < ' a > ,
125
125
}
126
126
127
- #[ visited_node ]
127
+ #[ ast ( visit ) ]
128
128
#[ derive( Debug , Hash ) ]
129
129
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
130
130
#[ cfg_attr( feature = "serialize" , serde( untagged) ) ]
@@ -133,7 +133,7 @@ pub enum JSXMemberExpressionObject<'a> {
133
133
MemberExpression ( Box < ' a , JSXMemberExpression < ' a > > ) ,
134
134
}
135
135
136
- #[ visited_node ]
136
+ #[ ast ( visit ) ]
137
137
#[ derive( Debug , Hash ) ]
138
138
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
139
139
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -149,7 +149,7 @@ inherit_variants! {
149
149
/// Inherits variants from [`Expression`]. See [`ast` module docs] for explanation of inheritance.
150
150
///
151
151
/// [`ast` module docs]: `super`
152
- #[ visited_node ]
152
+ #[ ast ( visit ) ]
153
153
#[ repr( C , u8 ) ]
154
154
#[ derive( Debug , Hash ) ]
155
155
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
@@ -161,7 +161,7 @@ pub enum JSXExpression<'a> {
161
161
}
162
162
}
163
163
164
- #[ visited_node ]
164
+ #[ ast ( visit ) ]
165
165
#[ derive( Debug , Hash ) ]
166
166
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
167
167
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -173,7 +173,7 @@ pub struct JSXEmptyExpression {
173
173
// 1.3 JSX Attributes
174
174
175
175
/// JSX Attributes
176
- #[ visited_node ]
176
+ #[ ast ( visit ) ]
177
177
#[ derive( Debug , Hash ) ]
178
178
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
179
179
#[ cfg_attr( feature = "serialize" , serde( untagged) ) ]
@@ -183,7 +183,7 @@ pub enum JSXAttributeItem<'a> {
183
183
}
184
184
185
185
/// JSX Attribute
186
- #[ visited_node ]
186
+ #[ ast ( visit ) ]
187
187
#[ derive( Debug , Hash ) ]
188
188
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
189
189
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -195,7 +195,7 @@ pub struct JSXAttribute<'a> {
195
195
}
196
196
197
197
/// JSX Spread Attribute
198
- #[ visited_node ]
198
+ #[ ast ( visit ) ]
199
199
#[ derive( Debug , Hash ) ]
200
200
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
201
201
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -206,7 +206,7 @@ pub struct JSXSpreadAttribute<'a> {
206
206
}
207
207
208
208
/// JSX Attribute Name
209
- #[ visited_node ]
209
+ #[ ast ( visit ) ]
210
210
#[ derive( Debug , Hash ) ]
211
211
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
212
212
#[ cfg_attr( feature = "serialize" , serde( untagged) ) ]
@@ -216,7 +216,7 @@ pub enum JSXAttributeName<'a> {
216
216
}
217
217
218
218
/// JSX Attribute Value
219
- #[ visited_node ]
219
+ #[ ast ( visit ) ]
220
220
#[ derive( Debug , Hash ) ]
221
221
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
222
222
#[ cfg_attr( feature = "serialize" , serde( untagged) ) ]
@@ -227,7 +227,7 @@ pub enum JSXAttributeValue<'a> {
227
227
Fragment ( Box < ' a , JSXFragment < ' a > > ) ,
228
228
}
229
229
230
- #[ visited_node ]
230
+ #[ ast ( visit ) ]
231
231
#[ derive( Debug , Hash ) ]
232
232
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
233
233
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -240,7 +240,7 @@ pub struct JSXIdentifier<'a> {
240
240
// 1.4 JSX Children
241
241
242
242
/// JSX Child
243
- #[ visited_node ]
243
+ #[ ast ( visit ) ]
244
244
#[ derive( Debug , Hash ) ]
245
245
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
246
246
#[ cfg_attr( feature = "serialize" , serde( untagged) ) ]
@@ -252,7 +252,7 @@ pub enum JSXChild<'a> {
252
252
Spread ( Box < ' a , JSXSpreadChild < ' a > > ) ,
253
253
}
254
254
255
- #[ visited_node ]
255
+ #[ ast ( visit ) ]
256
256
#[ derive( Debug , Hash ) ]
257
257
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
258
258
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
@@ -262,7 +262,7 @@ pub struct JSXSpreadChild<'a> {
262
262
pub expression : Expression < ' a > ,
263
263
}
264
264
265
- #[ visited_node ]
265
+ #[ ast ( visit ) ]
266
266
#[ derive( Debug , Hash ) ]
267
267
#[ cfg_attr( feature = "serialize" , derive( Serialize , Tsify ) ) ]
268
268
#[ cfg_attr( feature = "serialize" , serde( tag = "type" ) ) ]
0 commit comments