// cache a direct reference to the source text, so that we don't have to
// retrieve it via `self.source_file.src.as_ref().unwrap()` all the time.
src: Lrc<String>,
- token: token::Token,
- span: Span,
- /// The raw source span which *does not* take `override_span` into account
- span_src_raw: Span,
- /// Stack of open delimiters and their spans. Used for error message.
- open_braces: Vec<(token::DelimToken, Span)>,
- crate unmatched_braces: Vec<UnmatchedBrace>,
- /// The type and spans for all braces
- ///
- /// Used only for error recovery when arriving to EOF with mismatched braces.
- matching_delim_spans: Vec<(token::DelimToken, Span, Span)>,
- crate override_span: Option<Span>,
- last_unclosed_found_span: Option<Span>,
+ override_span: Option<Span>,
}
impl<'a> StringReader<'a> {
sp: self.peek_span,
};
self.advance_token()?;
- self.span_src_raw = self.peek_span_src_raw;
-
Ok(ret_val)
}
}
}
- self.token = t.tok.clone();
- self.span = t.sp;
-
Ok(t)
}
peek_span_src_raw: syntax_pos::DUMMY_SP,
src,
fatal_errs: Vec::new(),
- token: token::Eof,
- span: syntax_pos::DUMMY_SP,
- span_src_raw: syntax_pos::DUMMY_SP,
- open_braces: Vec::new(),
- unmatched_braces: Vec::new(),
- matching_delim_spans: Vec::new(),
override_span,
- last_unclosed_found_span: None,
}
}