From 9319f87a7b247fbf766e1c4dab0673596a6a728d Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Mon, 4 Jul 2022 17:47:59 +0800 Subject: [PATCH] Fix builds. --- src/parser.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index d1c2aff4..cfa594a5 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -76,18 +76,22 @@ pub struct ParseState<'e> { impl fmt::Debug for ParseState<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("ParseState") - .field("tokenizer_control", &self.tokenizer_control) + let mut f = f.debug_struct("ParseState"); + + f.field("tokenizer_control", &self.tokenizer_control) .field("interned_strings", &self.interned_strings) .field("scope", &self.scope) .field("global", &self.global) .field("stack", &self.stack) - .field("block_stack_len", &self.block_stack_len) - .field("external_vars", &self.external_vars) - .field("allow_capture", &self.allow_capture) - .field("imports", &self.imports) - .field("max_expr_depth", &self.max_expr_depth) - .finish() + .field("block_stack_len", &self.block_stack_len); + #[cfg(not(feature = "no_closure"))] + f.field("external_vars", &self.external_vars) + .field("allow_capture", &self.allow_capture); + #[cfg(not(feature = "no_module"))] + f.field("imports", &self.imports); + #[cfg(not(feature = "unchecked"))] + f.field("max_expr_depth", &self.max_expr_depth); + f.finish() } }