mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +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
|
@ -172,7 +172,7 @@ pub use crate::ast::SourceFile;
|
|||
impl SourceFile {
|
||||
pub fn parse(text: &str) -> Parse<SourceFile> {
|
||||
let _p = tracing::span!(tracing::Level::INFO, "SourceFile::parse").entered();
|
||||
let (green, errors) = parsing::parse_text(text);
|
||||
let (green, errors) = parsing::parse_text(text, parser::Edition::Edition2021);
|
||||
let root = SyntaxNode::new_root(green.clone());
|
||||
|
||||
assert_eq!(root.kind(), SyntaxKind::SOURCE_FILE);
|
||||
|
@ -185,7 +185,10 @@ impl SourceFile {
|
|||
}
|
||||
|
||||
impl ast::TokenTree {
|
||||
pub fn reparse_as_comma_separated_expr(self) -> Parse<ast::MacroEagerInput> {
|
||||
pub fn reparse_as_comma_separated_expr(
|
||||
self,
|
||||
edition: parser::Edition,
|
||||
) -> Parse<ast::MacroEagerInput> {
|
||||
let tokens = self.syntax().descendants_with_tokens().filter_map(NodeOrToken::into_token);
|
||||
|
||||
let mut parser_input = parser::Input::default();
|
||||
|
@ -219,8 +222,7 @@ impl ast::TokenTree {
|
|||
}
|
||||
}
|
||||
|
||||
let parser_output = parser::TopEntryPoint::MacroEagerInput
|
||||
.parse(&parser_input, parser::Edition::Edition2021);
|
||||
let parser_output = parser::TopEntryPoint::MacroEagerInput.parse(&parser_input, edition);
|
||||
|
||||
let mut tokens =
|
||||
self.syntax().descendants_with_tokens().filter_map(NodeOrToken::into_token);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue