File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,22 @@ impl SyntaxContext {
238238 } )
239239 }
240240
241+ /// Pulls a single mark off of the syntax context. This effectively moves the
242+ /// context up one macro definition level. That is, if we have a nested macro
243+ /// definition as follows:
244+ ///
245+ /// ```rust
246+ /// macro_rules! f {
247+ /// macro_rules! g {
248+ /// ...
249+ /// }
250+ /// }
251+ /// ```
252+ ///
253+ /// and we have a SyntaxContext that is referring to something declared by an invocation
254+ /// of g (call it g1), calling remove_mark will result in the SyntaxContext for the
255+ /// invocation of f that created g1.
256+ /// Returns the mark that was removed.
241257 pub fn remove_mark ( & mut self ) -> Mark {
242258 HygieneData :: with ( |data| {
243259 let outer_mark = data. syntax_contexts [ self . 0 as usize ] . outer_mark ;
You can’t perform that action at this time.
0 commit comments