/// Extend a syntax context with a given mark
Extend a syntax context with a given mark
Extend a syntax context with a given mark
pub fn apply_mark(self, mark: Mark) -> SyntaxContext {
        // Applying the same mark twice is a no-op
        let ctxt_data = self.data();
        if mark == ctxt_data.outer_mark {
            return ctxt_data.prev_ctxt;
        }
        HygieneData::with(|data| {
            let syntax_contexts = &mut data.syntax_contexts;
            *data.markings.entry((self, mark)).or_insert_with(|| {
                syntax_contexts.push(SyntaxContextData {
                    outer_mark: mark,
                    prev_ctxt: self,
                });
                SyntaxContext(syntax_contexts.len() as u32 - 1)
            })
        })
    }
pub fn apply_mark ( self , mark : Mark ) -> SyntaxContext { // Applying the same mark twice is a no-op let ctxt_data = self . data ( ) ; if mark == ctxt_data . outer_mark { return ctxt_data . prev_ctxt ; } HygieneData :: with ( | data | { let syntax_contexts = & mut data . syntax_contexts ; * data . markings . entry ( ( self , mark ) ) . or_insert_with ( | | { syntax_contexts . push ( SyntaxContextData { outer_mark : mark , prev_ctxt : self , } ) ; SyntaxContext ( syntax_contexts . len ( ) as u32 - 1 ) } ) } ) }
Extend a syntax context with a given mark
Extend a syntax context with a given mark
self
mark
Mark