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/mbe/src/mbe_expander/matcher.rs | 2 +- crates/mbe/src/mbe_expander/transcriber.rs | 2 +- crates/mbe/src/syntax_bridge.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/mbe/src') diff --git a/crates/mbe/src/mbe_expander/matcher.rs b/crates/mbe/src/mbe_expander/matcher.rs index c6d615c81..d32e60521 100644 --- a/crates/mbe/src/mbe_expander/matcher.rs +++ b/crates/mbe/src/mbe_expander/matcher.rs @@ -378,7 +378,7 @@ pub(super) fn match_repeat( src: &mut TtIter, ) -> Result<(), ExpandError> { // Dirty hack to make macro-expansion terminate. - // This should be replaced by a propper macro-by-example implementation + // This should be replaced by a proper macro-by-example implementation let mut limit = 65536; let mut counter = 0; diff --git a/crates/mbe/src/mbe_expander/transcriber.rs b/crates/mbe/src/mbe_expander/transcriber.rs index 27b2ac777..7194a107b 100644 --- a/crates/mbe/src/mbe_expander/transcriber.rs +++ b/crates/mbe/src/mbe_expander/transcriber.rs @@ -67,7 +67,7 @@ struct NestingState { /// because there is no variable in use by the current repetition hit: bool, /// `at_end` is currently necessary to tell `expand_repeat` if it should stop - /// because there is no more value avaible for the current repetition + /// because there is no more value available for the current repetition at_end: bool, } diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs index 671036e1c..244a81e99 100644 --- a/crates/mbe/src/syntax_bridge.rs +++ b/crates/mbe/src/syntax_bridge.rs @@ -149,7 +149,7 @@ impl TokenMap { } fn remove_delim(&mut self, idx: usize) { - // FIXME: This could be accidently quadratic + // FIXME: This could be accidentally quadratic self.entries.remove(idx); } } -- cgit v1.2.3 From 23f05aa1ad8d859d76253365d899941474e42501 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 8 Jan 2021 15:47:32 +0100 Subject: Fixed typos in `log::warn!` message --- crates/mbe/src/mbe_expander/transcriber.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'crates/mbe/src') diff --git a/crates/mbe/src/mbe_expander/transcriber.rs b/crates/mbe/src/mbe_expander/transcriber.rs index 7194a107b..59a3c80a8 100644 --- a/crates/mbe/src/mbe_expander/transcriber.rs +++ b/crates/mbe/src/mbe_expander/transcriber.rs @@ -179,11 +179,7 @@ fn expand_repeat( counter += 1; if counter == limit { - log::warn!( - "expand_tt excced in repeat pattern exceed limit => {:#?}\n{:#?}", - template, - ctx - ); + log::warn!("expand_tt in repeat pattern exceed limit => {:#?}\n{:#?}", template, ctx); break; } -- cgit v1.2.3 From 4702c01553a8747f72026a52269426097b4cc4d5 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 8 Jan 2021 15:41:08 +0100 Subject: Fixed typos in tests --- crates/mbe/src/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/mbe/src') diff --git a/crates/mbe/src/tests.rs b/crates/mbe/src/tests.rs index d854985c5..ecea15c11 100644 --- a/crates/mbe/src/tests.rs +++ b/crates/mbe/src/tests.rs @@ -1967,7 +1967,7 @@ fn test_no_space_after_semi_colon() { #[test] fn test_rustc_issue_57597() { fn test_error(fixture: &str) { - assert_eq!(parse_macro_error(fixture), ParseError::RepetitionEmtpyTokenTree); + assert_eq!(parse_macro_error(fixture), ParseError::RepetitionEmptyTokenTree); } test_error("macro_rules! foo { ($($($i:ident)?)+) => {}; }"); -- cgit v1.2.3 From 5877db28b499eb023aeddf9ceba0edc95b9d73a3 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 8 Jan 2021 15:41:46 +0100 Subject: Fixed typos in private type names --- crates/mbe/src/syntax_bridge.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/mbe/src') diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs index 244a81e99..e648519f9 100644 --- a/crates/mbe/src/syntax_bridge.rs +++ b/crates/mbe/src/syntax_bridge.rs @@ -476,14 +476,14 @@ impl Convertor { #[derive(Debug)] enum SynToken { - Ordiniary(SyntaxToken), + Ordinary(SyntaxToken), Punch(SyntaxToken, TextSize), } impl SynToken { fn token(&self) -> &SyntaxToken { match self { - SynToken::Ordiniary(it) => it, + SynToken::Ordinary(it) => it, SynToken::Punch(it, _) => it, } } @@ -495,7 +495,7 @@ impl SrcToken for SynToken { } fn to_char(&self) -> Option { match self { - SynToken::Ordiniary(_) => None, + SynToken::Ordinary(_) => None, SynToken::Punch(it, i) => it.text().chars().nth((*i).into()), } } @@ -535,7 +535,7 @@ impl TokenConvertor for Convertor { } else { self.punct_offset = None; let range = curr.text_range(); - (SynToken::Ordiniary(curr), range) + (SynToken::Ordinary(curr), range) }; Some(token) @@ -557,7 +557,7 @@ impl TokenConvertor for Convertor { let token = if curr.kind().is_punct() { SynToken::Punch(curr, 0.into()) } else { - SynToken::Ordiniary(curr) + SynToken::Ordinary(curr) }; Some(token) } -- cgit v1.2.3 From 586f84c73054fe6ec29274ece6d8bc9c9f6d1023 Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Fri, 8 Jan 2021 15:42:40 +0100 Subject: Fixed typos in public type names --- crates/mbe/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/mbe/src') diff --git a/crates/mbe/src/lib.rs b/crates/mbe/src/lib.rs index b3472879d..19543d777 100644 --- a/crates/mbe/src/lib.rs +++ b/crates/mbe/src/lib.rs @@ -24,7 +24,7 @@ use crate::{ #[derive(Debug, PartialEq, Eq)] pub enum ParseError { Expected(String), - RepetitionEmtpyTokenTree, + RepetitionEmptyTokenTree, } #[derive(Debug, PartialEq, Eq, Clone)] @@ -270,7 +270,7 @@ fn validate(pattern: &MetaTemplate) -> Result<(), ParseError> { } false }) { - return Err(ParseError::RepetitionEmtpyTokenTree); + return Err(ParseError::RepetitionEmptyTokenTree); } } validate(subtree)? -- cgit v1.2.3