mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +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() {
|
||||
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![]));
|
||||
}
|
||||
T![')'] | T!['}'] | T![']'] => {
|
||||
// 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
|
||||
.last_mut()
|
||||
.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)
|
||||
}
|
||||
|
||||
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 lexed = parser::LexedStr::new(text);
|
||||
let parser_input = lexed.to_input();
|
||||
|
|
Loading…
Reference in a new issue