Move token tree related lexer state to a separate struct
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
This commit is contained in:
@@ -66,15 +66,7 @@ pub struct StringReader<'a> {
|
||||
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> {
|
||||
@@ -254,11 +246,7 @@ impl<'a> StringReader<'a> {
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user