mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Raise edition one more level
This commit is contained in:
parent
454e481422
commit
2cf5d8811a
13 changed files with 61 additions and 35 deletions
|
@ -119,6 +119,7 @@ where
|
|||
pub fn token_tree_to_syntax_node<Ctx>(
|
||||
tt: &tt::Subtree<SpanData<Ctx>>,
|
||||
entry_point: parser::TopEntryPoint,
|
||||
edition: parser::Edition,
|
||||
) -> (Parse<SyntaxNode>, SpanMap<Ctx>)
|
||||
where
|
||||
SpanData<Ctx>: Copy + fmt::Debug,
|
||||
|
@ -131,7 +132,7 @@ where
|
|||
_ => TokenBuffer::from_subtree(tt),
|
||||
};
|
||||
let parser_input = to_parser_input(&buffer);
|
||||
let parser_output = entry_point.parse(&parser_input, parser::Edition::Edition2021);
|
||||
let parser_output = entry_point.parse(&parser_input, edition);
|
||||
let mut tree_sink = TtTreeSink::new(buffer.begin());
|
||||
for event in parser_output.iter() {
|
||||
match event {
|
||||
|
@ -194,7 +195,8 @@ where
|
|||
let mut res = Vec::new();
|
||||
|
||||
while iter.peek_n(0).is_some() {
|
||||
let expanded = iter.expect_fragment(parser::PrefixEntryPoint::Expr);
|
||||
let expanded =
|
||||
iter.expect_fragment(parser::PrefixEntryPoint::Expr, parser::Edition::Edition2021);
|
||||
|
||||
res.push(match expanded.value {
|
||||
None => break,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue