Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix: closure checking apostrophe confusingly named `is_tack` (#3511)

Andrew Dunbar8e285862102a
diff --git a/harper-core/src/lexing/mod.rs b/harper-core/src/lexing/mod.rs
index 0bb093149..3d9cf025c 100644
--- a/harper-core/src/lexing/mod.rs
+++ b/harper-core/src/lexing/mod.rs
@@ -84,14 +84,14 @@ pub fn lex_english_token(source: &[char]) -> FoundToken {
}
fn lex_word(source: &[char]) -> Option<FoundToken> {
- let is_tack = |c: char| lex_punctuation(&[c]).is_some_and(|t| t.token.is_apostrophe());
+ let is_apostrophe = |c: char| lex_punctuation(&[c]).is_some_and(|t| t.token.is_apostrophe());
let mut end = source
.iter()
- .position(|c| !c.is_english_lingual() && !c.is_ascii_digit() && !is_tack(*c))
+ .position(|c| !c.is_english_lingual() && !c.is_ascii_digit() && !is_apostrophe(*c))
.unwrap_or(source.len());
- while end >= 1 && is_tack(source[end - 1]) {
+ while end >= 1 && is_apostrophe(source[end - 1]) {
end -= 1;
}