mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-28 04:45:05 +00:00
fix typos & formatting
This commit is contained in:
parent
cf9401049c
commit
a741bb2055
2 changed files with 7 additions and 3 deletions
|
@ -927,12 +927,12 @@ pub(crate) fn tt_from_syntax(node: SyntaxNode) -> Vec<NodeOrToken<ast::TokenTree
|
||||||
|
|
||||||
match token.kind() {
|
match token.kind() {
|
||||||
T!['('] | T!['{'] | T!['['] => {
|
T!['('] | T!['{'] | T!['['] => {
|
||||||
// Found an opening delimeter, start a new sub token tree
|
// Found an opening delimiter, start a new sub token tree
|
||||||
tt_stack.push((Some(token.kind()), vec![]));
|
tt_stack.push((Some(token.kind()), vec![]));
|
||||||
}
|
}
|
||||||
T![')'] | T!['}'] | T![']'] => {
|
T![')'] | T!['}'] | T![']'] => {
|
||||||
// Closing a subtree
|
// Closing a subtree
|
||||||
let (delimiter, tt) = tt_stack.pop().expect("unbalanced delimeters");
|
let (delimiter, tt) = tt_stack.pop().expect("unbalanced delimiters");
|
||||||
let (_, parent_tt) = tt_stack
|
let (_, parent_tt) = tt_stack
|
||||||
.last_mut()
|
.last_mut()
|
||||||
.expect("parent token tree was closed before it was completed");
|
.expect("parent token tree was closed before it was completed");
|
||||||
|
|
|
@ -18,7 +18,11 @@ pub(crate) fn parse_text(text: &str, edition: parser::Edition) -> (GreenNode, Ve
|
||||||
(node, errors)
|
(node, errors)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn parse_text_at(text: &str, entry: parser::TopEntryPoint, edition: parser::Edition) -> (GreenNode, Vec<SyntaxError>) {
|
pub(crate) fn parse_text_at(
|
||||||
|
text: &str,
|
||||||
|
entry: parser::TopEntryPoint,
|
||||||
|
edition: parser::Edition,
|
||||||
|
) -> (GreenNode, Vec<SyntaxError>) {
|
||||||
let _p = tracing::span!(tracing::Level::INFO, "parse_text_at").entered();
|
let _p = tracing::span!(tracing::Level::INFO, "parse_text_at").entered();
|
||||||
let lexed = parser::LexedStr::new(text);
|
let lexed = parser::LexedStr::new(text);
|
||||||
let parser_input = lexed.to_input();
|
let parser_input = lexed.to_input();
|
||||||
|
|
Loading…
Reference in a new issue