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') 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') 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') 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 Date: Sun, 10 Jan 2021 17:12:02 +0100 Subject: Updated tests via `cargo xtask codegen` --- .../parser/inline/ok/0002_use_tree_list.rast | 98 +++++++++++----------- .../parser/inline/ok/0002_use_tree_list.rs | 2 +- 2 files changed, 50 insertions(+), 50 deletions(-) (limited to 'crates/syntax') diff --git a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast b/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast index b1fb75ed1..f40500e38 100644 --- a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast +++ b/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast @@ -1,4 +1,4 @@ -SOURCE_FILE@0..249 +SOURCE_FILE@0..248 USE@0..58 USE_KW@0..3 "use" WHITESPACE@3..4 " " @@ -75,62 +75,62 @@ SOURCE_FILE@0..249 R_CURLY@119..120 "}" SEMICOLON@120..121 ";" WHITESPACE@121..122 " " - USE@122..166 + USE@122..165 COMMENT@122..134 "// Rust 2015" WHITESPACE@134..135 "\n" USE_KW@135..138 "use" WHITESPACE@138..139 " " - USE_TREE@139..165 + USE_TREE@139..164 COLON2@139..141 "::" - USE_TREE_LIST@141..165 + USE_TREE_LIST@141..164 L_CURLY@141..142 "{" - USE_TREE@142..164 - PATH@142..164 - PATH@142..158 + USE_TREE@142..163 + PATH@142..163 + PATH@142..157 PATH@142..146 PATH_SEGMENT@142..146 NAME_REF@142..146 IDENT@142..146 "some" COLON2@146..148 "::" - PATH_SEGMENT@148..158 - NAME_REF@148..158 - IDENT@148..158 "arbritrary" - COLON2@158..160 "::" - PATH_SEGMENT@160..164 - NAME_REF@160..164 - IDENT@160..164 "path" - R_CURLY@164..165 "}" - SEMICOLON@165..166 ";" - WHITESPACE@166..167 " " - USE@167..205 - COMMENT@167..179 "// Rust 2015" - WHITESPACE@179..180 "\n" - USE_KW@180..183 "use" - WHITESPACE@183..184 " " - USE_TREE@184..204 - COLON2@184..186 "::" - USE_TREE_LIST@186..204 - L_CURLY@186..187 "{" - USE_TREE@187..203 - USE_TREE_LIST@187..203 - L_CURLY@187..188 "{" - USE_TREE@188..202 - USE_TREE_LIST@188..202 - L_CURLY@188..189 "{" - USE_TREE@189..201 - PATH@189..201 - PATH@189..193 - PATH_SEGMENT@189..193 - NAME_REF@189..193 - IDENT@189..193 "root" - COLON2@193..195 "::" - PATH_SEGMENT@195..201 - NAME_REF@195..201 - IDENT@195..201 "export" - R_CURLY@201..202 "}" - R_CURLY@202..203 "}" - R_CURLY@203..204 "}" - SEMICOLON@204..205 ";" - WHITESPACE@205..206 " " - COMMENT@206..248 "// Nonsensical but pe ..." - WHITESPACE@248..249 "\n" + PATH_SEGMENT@148..157 + NAME_REF@148..157 + IDENT@148..157 "arbitrary" + COLON2@157..159 "::" + PATH_SEGMENT@159..163 + NAME_REF@159..163 + IDENT@159..163 "path" + R_CURLY@163..164 "}" + SEMICOLON@164..165 ";" + WHITESPACE@165..166 " " + USE@166..204 + COMMENT@166..178 "// Rust 2015" + WHITESPACE@178..179 "\n" + USE_KW@179..182 "use" + WHITESPACE@182..183 " " + USE_TREE@183..203 + COLON2@183..185 "::" + USE_TREE_LIST@185..203 + L_CURLY@185..186 "{" + USE_TREE@186..202 + USE_TREE_LIST@186..202 + L_CURLY@186..187 "{" + USE_TREE@187..201 + USE_TREE_LIST@187..201 + L_CURLY@187..188 "{" + USE_TREE@188..200 + PATH@188..200 + PATH@188..192 + PATH_SEGMENT@188..192 + NAME_REF@188..192 + IDENT@188..192 "root" + COLON2@192..194 "::" + PATH_SEGMENT@194..200 + NAME_REF@194..200 + IDENT@194..200 "export" + R_CURLY@200..201 "}" + R_CURLY@201..202 "}" + R_CURLY@202..203 "}" + SEMICOLON@203..204 ";" + WHITESPACE@204..205 " " + COMMENT@205..247 "// Nonsensical but pe ..." + WHITESPACE@247..248 "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rs b/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rs index 381cba1e2..02af4b446 100644 --- a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rs +++ b/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rs @@ -1,4 +1,4 @@ use {crate::path::from::root, or::path::from::crate_name}; // Rust 2018 (with a crate named `or`) use {path::from::root}; // Rust 2015 -use ::{some::arbritrary::path}; // Rust 2015 +use ::{some::arbitrary::path}; // Rust 2015 use ::{{{root::export}}}; // Nonsensical but perfectly legal nesting -- cgit v1.2.3