From 21f8239ac8be6093967bc91ec155782d37efcb6a Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 8 Jan 2021 15:46:48 +0100 Subject: Fixed typos in code comments --- crates/syntax/src/ast/make.rs | 2 +- crates/syntax/src/parsing/lexer.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/syntax/src') diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index cafa4c198..1ed8a96e5 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -241,7 +241,7 @@ pub fn wildcard_pat() -> ast::WildcardPat { } } -/// Creates a tuple of patterns from an interator of patterns. +/// Creates a tuple of patterns from an iterator of patterns. /// /// Invariant: `pats` must be length > 1 /// diff --git a/crates/syntax/src/parsing/lexer.rs b/crates/syntax/src/parsing/lexer.rs index 0cbba73c5..7c8d0a4c4 100644 --- a/crates/syntax/src/parsing/lexer.rs +++ b/crates/syntax/src/parsing/lexer.rs @@ -24,7 +24,7 @@ pub struct Token { /// Beware that it checks for shebang first and its length contributes to resulting /// tokens offsets. pub fn tokenize(text: &str) -> (Vec, Vec) { - // non-empty string is a precondtion of `rustc_lexer::strip_shebang()`. + // non-empty string is a precondition of `rustc_lexer::strip_shebang()`. if text.is_empty() { return Default::default(); } @@ -76,7 +76,7 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option Option { @@ -96,7 +96,7 @@ pub fn lex_single_valid_syntax_kind(text: &str) -> Option { /// /// Beware that unescape errors are not checked at tokenization time. fn lex_first_token(text: &str) -> Option<(Token, Option)> { - // non-empty string is a precondtion of `rustc_lexer::first_token()`. + // non-empty string is a precondition of `rustc_lexer::first_token()`. if text.is_empty() { return None; } @@ -117,7 +117,7 @@ fn rustc_token_kind_to_syntax_kind( token_text: &str, ) -> (SyntaxKind, Option<&'static str>) { // A note on an intended tradeoff: - // We drop some useful infromation here (see patterns with double dots `..`) + // We drop some useful information here (see patterns with double dots `..`) // Storing that info in `SyntaxKind` is not possible due to its layout requirements of // being `u16` that come from `rowan::SyntaxKind`. -- cgit v1.2.3 From 6cd93db8a5a09d7ab75d52a772289e390e35d8a2 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 8 Jan 2021 15:40:38 +0100 Subject: Fixed typos in code asserts --- crates/syntax/src/validation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/syntax/src') diff --git a/crates/syntax/src/validation.rs b/crates/syntax/src/validation.rs index 2ddaeb176..b3a02f4ae 100644 --- a/crates/syntax/src/validation.rs +++ b/crates/syntax/src/validation.rs @@ -173,7 +173,7 @@ pub(crate) fn validate_block_structure(root: &SyntaxNode) { assert_eq!( node.parent(), pair.parent(), - "\nunpaired curleys:\n{}\n{:#?}\n", + "\nunpaired curlys:\n{}\n{:#?}\n", root.text(), root, ); -- cgit v1.2.3 From c8c2bd097a8cb47b3105d32d9d22c6f2c7fbd590 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 8 Jan 2021 15:41:32 +0100 Subject: Fixed typos in local bindings --- crates/syntax/src/algo.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/syntax/src') diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 22ab36cd2..384d031e7 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs @@ -88,8 +88,8 @@ pub fn least_common_ancestor(u: &SyntaxNode, v: &SyntaxNode) -> Option