mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-23 02:24:08 +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
|
@ -9,12 +9,11 @@ use crate::{syntax_node::GreenNode, SyntaxError, SyntaxTreeBuilder};
|
|||
|
||||
pub(crate) use crate::parsing::reparsing::incremental_reparse;
|
||||
|
||||
pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
|
||||
pub(crate) fn parse_text(text: &str, edition: parser::Edition) -> (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, parser::Edition::Edition2021);
|
||||
let parser_output = parser::TopEntryPoint::SourceFile.parse(&parser_input, edition);
|
||||
let (node, errors, _eof) = build_tree(lexed, parser_output);
|
||||
(node, errors)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue