Skip to content

Commit

Permalink
style: reformatted things a bit; fixed nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew15-5 authored and grantlemons committed Jan 16, 2025
1 parent f448dc9 commit de61c4c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
36 changes: 18 additions & 18 deletions harper-typst/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
]
))
}
Expand All @@ -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
]
))
}
Expand All @@ -160,13 +160,13 @@ mod tests {
TokenKind::Unlintable, // authors_slice.join
TokenKind::Punctuation(Punctuation::Comma),
TokenKind::Space(1),
TokenKind::Unlintable, // Ident
TokenKind::Unlintable, // last
TokenKind::Punctuation(Punctuation::Comma),
TokenKind::Space(1),
TokenKind::Word(_), // and
TokenKind::Space(1),
TokenKind::Space(2),
TokenKind::Word(_),
TokenKind::Word(_), // bob
]
))
}
Expand Down
2 changes: 1 addition & 1 deletion harper-typst/tests/test_sources/complex_document.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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(", ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(", ")
Expand Down

0 comments on commit de61c4c

Please sign in to comment.