Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
style: reformatted things a bit; fixed nitpicks
Andrew Voynovde61c4cbf966
diff --git a/harper-typst/src/lib.rs b/harper-typst/src/lib.rsindex 24836285f..9668fc527 100644--- a/harper-typst/src/lib.rs+++ b/harper-typst/src/lib.rs@@ -99,9 +99,9 @@ mod tests {#[test]fn dict_parsing() {let source = r#"#let dict = (- name: "Typst",- born: 2019,- )"#;+ name: "Typst",+ born: 2019,+ )"#;let document = Document::new_curated(source, &Typst);let token_kinds = document.tokens().map(|t| t.kind).collect_vec();@@ -114,11 +114,11 @@ mod tests {assert!(matches!(token_kinds.as_slice(),&[- TokenKind::Unlintable, // Ident- TokenKind::Unlintable, // Key 1- TokenKind::Word(_), // Value 1- TokenKind::Unlintable, // Key 2- TokenKind::Unlintable, // Value 2+ TokenKind::Unlintable, // dict+ TokenKind::Unlintable, // name (key 1)+ TokenKind::Word(_), // Typst (value 1)+ TokenKind::Unlintable, // born (key 2)+ TokenKind::Unlintable, // 2019 (value 2)]))}@@ -134,14 +134,14 @@ mod tests {assert!(matches!(&token_kinds.as_slice(),&[- TokenKind::Unlintable,- TokenKind::Word(_), // This- TokenKind::Space(1),- TokenKind::Word(_), // Is- TokenKind::Space(1),- TokenKind::Word(_), // A- TokenKind::Space(1),- TokenKind::Word(_), // String+ TokenKind::Unlintable, // ident+ TokenKind::Word(_), // This+ TokenKind::Space(1), //+ TokenKind::Word(_), // is+ TokenKind::Space(1), //+ TokenKind::Word(_), // a+ TokenKind::Space(1), //+ TokenKind::Word(_), // string]))}@@ -160,13 +160,13 @@ mod tests {TokenKind::Unlintable, // authors_slice.joinTokenKind::Punctuation(Punctuation::Comma),TokenKind::Space(1),- TokenKind::Unlintable, // Ident+ TokenKind::Unlintable, // lastTokenKind::Punctuation(Punctuation::Comma),TokenKind::Space(1),TokenKind::Word(_), // andTokenKind::Space(1),TokenKind::Space(2),- TokenKind::Word(_),+ TokenKind::Word(_), // bob]))}diff --git a/harper-typst/tests/test_sources/complex_document.typ b/harper-typst/tests/test_sources/complex_document.typindex 42aa16b17..1a6c65c54 100644--- a/harper-typst/tests/test_sources/complex_document.typ+++ b/harper-typst/tests/test_sources/complex_document.typ@@ -31,7 +31,7 @@#let count = authors.len()#let authors_slice = authors.slice(0, calc.min(count, 3))_#if count > 3 {- // et al. isn't parsed properly, but this isn't the fault of the typst+ // et al. isn't parsed properly, but this isn't the fault of the Typst// parser// authors_slice.push("et al.")authors_slice.join(", ")diff --git a/harper-typst/tests/test_sources/complex_with_spelling_mistakes.typ b/harper-typst/tests/test_sources/complex_with_spelling_mistakes.typindex 0c82635c3..6e65b73fe 100644--- a/harper-typst/tests/test_sources/complex_with_spelling_mistakes.typ+++ b/harper-typst/tests/test_sources/complex_with_spelling_mistakes.typ@@ -31,7 +31,7 @@#let count = authors.len()#let authors_slice = authors.slice(0, calc.min(count, 3))_#if count > 3 {- // et al. isn't parsed properly, but this isn't the fault of the typst+ // et al. isn't parsed properly, but this isn't the fault of the Typst// parser// authors_slice.push("et al.")authors_slice.join(", ")