fix typos & formatting

This commit is contained in:
DropDemBits 2024-06-02 14:09:36 -04:00
parent cf9401049c
commit a741bb2055
No known key found for this signature in database
GPG key ID: 7FE02A6C1EDFA075
2 changed files with 7 additions and 3 deletions

View file

@ -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");

View file

@ -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();