mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-13 22:06:56 +00:00
Add edition to all parse
functions of the parser crate
This commit is contained in:
parent
392538c830
commit
454e481422
9 changed files with 16 additions and 20 deletions
|
@ -219,7 +219,8 @@ impl ast::TokenTree {
|
|||
}
|
||||
}
|
||||
|
||||
let parser_output = parser::TopEntryPoint::MacroEagerInput.parse(&parser_input);
|
||||
let parser_output = parser::TopEntryPoint::MacroEagerInput
|
||||
.parse(&parser_input, parser::Edition::Edition2021);
|
||||
|
||||
let mut tokens =
|
||||
self.syntax().descendants_with_tokens().filter_map(NodeOrToken::into_token);
|
||||
|
|
|
@ -13,7 +13,8 @@ pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
|
|||
let _p = tracing::span!(tracing::Level::INFO, "parse_text").entered();
|
||||
let lexed = parser::LexedStr::new(text);
|
||||
let parser_input = lexed.to_input();
|
||||
let parser_output = parser::TopEntryPoint::SourceFile.parse(&parser_input);
|
||||
let parser_output =
|
||||
parser::TopEntryPoint::SourceFile.parse(&parser_input, parser::Edition::Edition2021);
|
||||
let (node, errors, _eof) = build_tree(lexed, parser_output);
|
||||
(node, errors)
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ fn reparse_block(
|
|||
return None;
|
||||
}
|
||||
|
||||
let tree_traversal = reparser.parse(&parser_input);
|
||||
let tree_traversal = reparser.parse(&parser_input, parser::Edition::Edition2021);
|
||||
|
||||
let (green, new_parser_errors, _eof) = build_tree(lexed, tree_traversal);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue