@@ -209,18 +209,21 @@ fn generate_deserializers(
209209 }
210210 }
211211
212- // Create deserializers with various settings, by setting `IS_TS`, `RANGE`, `LOC`, `PARENT`
213- // and `PRESERVE_PARENS` consts, and running through minifier to shake out irrelevant code
212+ // Create deserializers with various settings, by setting `IS_TS`, `RANGE`, `LOC`, `PARENT`,
213+ // `PRESERVE_PARENS`, and `COMMENTS` consts, and running through minifier to shake out
214+ // irrelevant code
214215 struct VariantGen {
215216 variant_paths : Vec < String > ,
216217 }
217218
218- impl VariantGenerator < 5 > for VariantGen {
219- const FLAG_NAMES : [ & str ; 5 ] = [ "IS_TS" , "RANGE" , "LOC" , "PARENT" , "PRESERVE_PARENS" ] ;
219+ impl VariantGenerator < 6 > for VariantGen {
220+ const FLAG_NAMES : [ & str ; 6 ] =
221+ [ "IS_TS" , "RANGE" , "LOC" , "PARENT" , "PRESERVE_PARENS" , "COMMENTS" ] ;
220222
221- fn variants ( & mut self ) -> Vec < [ bool ; 5 ] > {
223+ fn variants ( & mut self ) -> Vec < [ bool ; 6 ] > {
222224 let mut variants = Vec :: with_capacity ( 9 ) ;
223225
226+ // Parser deserializers
224227 for is_ts in [ false , true ] {
225228 for range in [ false , true ] {
226229 for parent in [ false , true ] {
@@ -233,16 +236,17 @@ fn generate_deserializers(
233236
234237 variants. push ( [
235238 is_ts, range, /* loc */ false , parent,
236- /* preserve_parens */ true ,
239+ /* preserve_parens */ true , /* comments */ false ,
237240 ] ) ;
238241 }
239242 }
240243 }
241244
245+ // Linter deserializer
242246 self . variant_paths . push ( format ! ( "{OXLINT_APP_PATH}/src-js/generated/deserialize.js" ) ) ;
243247 variants. push ( [
244248 /* is_ts */ true , /* range */ true , /* loc */ true ,
245- /* parent */ true , /* preserve_parens */ false ,
249+ /* parent */ true , /* preserve_parens */ false , /* comments */ true ,
246250 ] ) ;
247251
248252 variants
@@ -251,7 +255,7 @@ fn generate_deserializers(
251255 fn pre_process_variant < ' a > (
252256 & mut self ,
253257 program : & mut Program < ' a > ,
254- flags : [ bool ; 5 ] ,
258+ flags : [ bool ; 6 ] ,
255259 allocator : & ' a Allocator ,
256260 ) {
257261 if flags[ 2 ] {
0 commit comments