File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
crates/oxc_ast/src/generated
tasks/ast_tools/src/generators Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,9 @@ pub enum AstType {
203203 JSDocUnknownType = 186 ,
204204}
205205
206+ /// The largest integer value that can be mapped to an `AstType`/`AstKind` enum variant.
207+ pub const AST_TYPE_MAX : u16 = 187 ;
208+
206209/// Untyped AST Node Kind
207210#[ derive( Debug , Clone , Copy ) ]
208211#[ repr( C , u8 ) ]
Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ impl Generator for AstKindGenerator {
132132 next_index += 1 ;
133133 }
134134
135+ let ast_type_max = number_lit ( next_index) ;
136+
135137 let output = quote ! {
136138 #![ expect( missing_docs) ] ///@ FIXME (in ast_tools/src/generators/ast_kind.rs)
137139
@@ -152,6 +154,10 @@ impl Generator for AstKindGenerator {
152154 #type_variants
153155 }
154156
157+ ///@@line_break
158+ /// The largest integer value that can be mapped to an `AstType`/`AstKind` enum variant.
159+ pub const AST_TYPE_MAX : u16 = #ast_type_max;
160+
155161 ///@@line_break
156162 /// Untyped AST Node Kind
157163 #[ derive( Debug , Clone , Copy ) ]
You can’t perform that action at this time.
0 commit comments