Skip to content

Commit e765e88

Browse files
committed
only replace . with if not surrounded by numbers
1 parent 13b6af0 commit e765e88

File tree

1 file changed

+12
-0
lines changed
  • crates/oxide/src/extractor/pre_processors

1 file changed

+12
-0
lines changed

crates/oxide/src/extractor/pre_processors/clojure.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ impl PreProcessor for Clojure {
4242
}
4343
}
4444

45+
// A `.` surrounded by digits is a decimal number, so we don't want to replace it.
46+
//
47+
// E.g.:
48+
// ```
49+
// gap-1.5
50+
// ^
51+
// ``
52+
b'.' if cursor.prev.is_ascii_digit() && cursor.next.is_ascii_digit() => {
53+
54+
// Keep the `.` as-is
55+
}
56+
4557
b':' | b'.' => {
4658
result[cursor.pos] = b' ';
4759
}

0 commit comments

Comments
 (0)