mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Parse contextual dyn keyword properly in edition 2015
This commit is contained in:
parent
9fd6c695da
commit
f4199f786e
10 changed files with 164 additions and 11 deletions
|
@ -27,14 +27,14 @@ pub(crate) struct Parser<'t> {
|
|||
pos: usize,
|
||||
events: Vec<Event>,
|
||||
steps: Cell<u32>,
|
||||
_edition: Edition,
|
||||
edition: Edition,
|
||||
}
|
||||
|
||||
static PARSER_STEP_LIMIT: Limit = Limit::new(15_000_000);
|
||||
|
||||
impl<'t> Parser<'t> {
|
||||
pub(super) fn new(inp: &'t Input, edition: Edition) -> Parser<'t> {
|
||||
Parser { inp, pos: 0, events: Vec::new(), steps: Cell::new(0), _edition: edition }
|
||||
Parser { inp, pos: 0, events: Vec::new(), steps: Cell::new(0), edition: edition }
|
||||
}
|
||||
|
||||
pub(crate) fn finish(self) -> Vec<Event> {
|
||||
|
@ -277,6 +277,10 @@ impl<'t> Parser<'t> {
|
|||
fn push_event(&mut self, event: Event) {
|
||||
self.events.push(event);
|
||||
}
|
||||
|
||||
pub(crate) fn edition(&self) -> Edition {
|
||||
self.edition
|
||||
}
|
||||
}
|
||||
|
||||
/// See [`Parser::start`].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue