pub fn lookahead_wrap_parens<'a>(
        &'a mut self,
        sequence: LookaheadSequence,
    ) -> FormatterLock<'a> {
        self.wrap_parens_inner(match self.lookahead_restriction {
            // No function/class declarations allowed
            Some(LookaheadRestriction::ExportDefault) => sequence == LookaheadSequence::Declaration,

            // No function/class declarations, opencurlies, or let[ allowed
            Some(LookaheadRestriction::ExpressionStatement) => sequence != LookaheadSequence::None,

            // No let[ allowed
            Some(LookaheadRestriction::ForInit) => sequence == LookaheadSequence::LetSquare,

            // No let[ allowed
            Some(LookaheadRestriction::ForOfInit) => {
                sequence == LookaheadSequence::Let || sequence == LookaheadSequence::LetSquare
            }

            // No { allowed
            Some(LookaheadRestriction::ConciseBody) => sequence == LookaheadSequence::Curly,

            None => false,
        })
    }
/// Creates a formatter lock that wraps the output in parens if the given sequence
/// matches a previously assigned lookahead restriction.
Creates a formatter lock that wraps the output in parens if the given sequence
matches a previously assigned lookahead restriction.
Creates a formatter lock that wraps the output in parens if the given sequence matches a previously assigned lookahead restriction .
pub fn lookahead_wrap_parens<'a>(
        &'a mut self,
        sequence: LookaheadSequence,
    ) -> FormatterLock<'a> {
        self.wrap_parens_inner(match self.lookahead_restriction {
            // No function/class declarations allowed
            Some(LookaheadRestriction::ExportDefault) => sequence == LookaheadSequence::Declaration,
            // No function/class declarations, opencurlies, or let[ allowed
            Some(LookaheadRestriction::ExpressionStatement) => sequence != LookaheadSequence::None,
            // No let[ allowed
            Some(LookaheadRestriction::ForInit) => sequence == LookaheadSequence::LetSquare,
            // No let[ allowed
            Some(LookaheadRestriction::ForOfInit) => {
                sequence == LookaheadSequence::Let || sequence == LookaheadSequence::LetSquare
            }
            // No { allowed
            Some(LookaheadRestriction::ConciseBody) => sequence == LookaheadSequence::Curly,
            None => false,
        })
    }
pub fn lookahead_wrap_parens < ' a > ( & ' a mut self , sequence : LookaheadSequence , ) -> FormatterLock < ' a > { self . wrap_parens_inner ( match self . lookahead_restriction { // No function/class declarations allowed Some ( LookaheadRestriction :: ExportDefault ) => sequence == LookaheadSequence :: Declaration , // No function/class declarations, opencurlies, or let[ allowed Some ( LookaheadRestriction :: ExpressionStatement ) => sequence != LookaheadSequence :: None , // No let[ allowed Some ( LookaheadRestriction :: ForInit ) => sequence == LookaheadSequence :: LetSquare , // No let[ allowed Some ( LookaheadRestriction :: ForOfInit ) => { sequence == LookaheadSequence :: Let || sequence == LookaheadSequence :: LetSquare } // No { allowed Some ( LookaheadRestriction :: ConciseBody ) => sequence == LookaheadSequence :: Curly , None => false , } ) }
Creates a formatter lock that wraps the output in parens if the given sequence
matches a previously assigned lookahead restriction.
Creates a formatter lock that wraps the output in parens if the given sequence matches a previously assigned lookahead restriction .
&'a mut self
sequence
LookaheadSequence