@@ -208,7 +208,7 @@ pub struct Tokenizer<'a> {
208
208
/// of UTF-16 characters.
209
209
current_line_start_position : usize ,
210
210
current_line_number : u32 ,
211
- var_functions : SeenStatus ,
211
+ var_or_env_functions : SeenStatus ,
212
212
source_map_url : Option < & ' a str > ,
213
213
source_url : Option < & ' a str > ,
214
214
}
@@ -234,29 +234,31 @@ impl<'a> Tokenizer<'a> {
234
234
position : 0 ,
235
235
current_line_start_position : 0 ,
236
236
current_line_number : first_line_number,
237
- var_functions : SeenStatus :: DontCare ,
237
+ var_or_env_functions : SeenStatus :: DontCare ,
238
238
source_map_url : None ,
239
239
source_url : None ,
240
240
}
241
241
}
242
242
243
243
#[ inline]
244
- pub fn look_for_var_functions ( & mut self ) {
245
- self . var_functions = SeenStatus :: LookingForThem ;
244
+ pub fn look_for_var_or_env_functions ( & mut self ) {
245
+ self . var_or_env_functions = SeenStatus :: LookingForThem ;
246
246
}
247
247
248
248
#[ inline]
249
- pub fn seen_var_functions ( & mut self ) -> bool {
250
- let seen = self . var_functions == SeenStatus :: SeenAtLeastOne ;
251
- self . var_functions = SeenStatus :: DontCare ;
249
+ pub fn seen_var_or_env_functions ( & mut self ) -> bool {
250
+ let seen = self . var_or_env_functions == SeenStatus :: SeenAtLeastOne ;
251
+ self . var_or_env_functions = SeenStatus :: DontCare ;
252
252
seen
253
253
}
254
254
255
255
#[ inline]
256
256
pub fn see_function ( & mut self , name : & str ) {
257
- if self . var_functions == SeenStatus :: LookingForThem {
258
- if name. eq_ignore_ascii_case ( "var" ) {
259
- self . var_functions = SeenStatus :: SeenAtLeastOne ;
257
+ if self . var_or_env_functions == SeenStatus :: LookingForThem {
258
+ if name. eq_ignore_ascii_case ( "var" ) ||
259
+ name. eq_ignore_ascii_case ( "env" )
260
+ {
261
+ self . var_or_env_functions = SeenStatus :: SeenAtLeastOne ;
260
262
}
261
263
}
262
264
}
0 commit comments