aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/syntax_bridge.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-10 18:16:29 +0000
committerGitHub <[email protected]>2021-01-10 18:16:29 +0000
commit607b9ea160149bacca41c0638f16d372c3b235cd (patch)
treec1ef9b29af2f080530fd3d79b9bb6622bcff0a2a /crates/mbe/src/syntax_bridge.rs
parent3e32e39da765632dd5c61d31b846bfa93738e786 (diff)
parentd4621197447d6906305ed30f8ab4fb48d657ec86 (diff)
Merge #7218
7218: Fix typos r=Veykril a=regexident Apart from the very last commit on this PR (which fixes a public type's name) all changes are non-breaking. Co-authored-by: Vincent Esche <[email protected]>
Diffstat (limited to 'crates/mbe/src/syntax_bridge.rs')
-rw-r--r--crates/mbe/src/syntax_bridge.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs
index 671036e1c..e648519f9 100644
--- a/crates/mbe/src/syntax_bridge.rs
+++ b/crates/mbe/src/syntax_bridge.rs
@@ -149,7 +149,7 @@ impl TokenMap {
149 } 149 }
150 150
151 fn remove_delim(&mut self, idx: usize) { 151 fn remove_delim(&mut self, idx: usize) {
152 // FIXME: This could be accidently quadratic 152 // FIXME: This could be accidentally quadratic
153 self.entries.remove(idx); 153 self.entries.remove(idx);
154 } 154 }
155} 155}
@@ -476,14 +476,14 @@ impl Convertor {
476 476
477#[derive(Debug)] 477#[derive(Debug)]
478enum SynToken { 478enum SynToken {
479 Ordiniary(SyntaxToken), 479 Ordinary(SyntaxToken),
480 Punch(SyntaxToken, TextSize), 480 Punch(SyntaxToken, TextSize),
481} 481}
482 482
483impl SynToken { 483impl SynToken {
484 fn token(&self) -> &SyntaxToken { 484 fn token(&self) -> &SyntaxToken {
485 match self { 485 match self {
486 SynToken::Ordiniary(it) => it, 486 SynToken::Ordinary(it) => it,
487 SynToken::Punch(it, _) => it, 487 SynToken::Punch(it, _) => it,
488 } 488 }
489 } 489 }
@@ -495,7 +495,7 @@ impl SrcToken for SynToken {
495 } 495 }
496 fn to_char(&self) -> Option<char> { 496 fn to_char(&self) -> Option<char> {
497 match self { 497 match self {
498 SynToken::Ordiniary(_) => None, 498 SynToken::Ordinary(_) => None,
499 SynToken::Punch(it, i) => it.text().chars().nth((*i).into()), 499 SynToken::Punch(it, i) => it.text().chars().nth((*i).into()),
500 } 500 }
501 } 501 }
@@ -535,7 +535,7 @@ impl TokenConvertor for Convertor {
535 } else { 535 } else {
536 self.punct_offset = None; 536 self.punct_offset = None;
537 let range = curr.text_range(); 537 let range = curr.text_range();
538 (SynToken::Ordiniary(curr), range) 538 (SynToken::Ordinary(curr), range)
539 }; 539 };
540 540
541 Some(token) 541 Some(token)
@@ -557,7 +557,7 @@ impl TokenConvertor for Convertor {
557 let token = if curr.kind().is_punct() { 557 let token = if curr.kind().is_punct() {
558 SynToken::Punch(curr, 0.into()) 558 SynToken::Punch(curr, 0.into())
559 } else { 559 } else {
560 SynToken::Ordiniary(curr) 560 SynToken::Ordinary(curr)
561 }; 561 };
562 Some(token) 562 Some(token)
563 } 563 }