Skip to content

Commit 8a3bce0

Browse files
committed
fix a number parsing/formatting bug
1 parent 576fba8 commit 8a3bce0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

parser/src/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,8 +1425,8 @@ impl Parser<'_> {
14251425
Ok(n) => n.to_string(),
14261426
Err(_) => s.into(),
14271427
};
1428-
if s.contains('`') {
1429-
s = s.replace('`', "¯");
1428+
if s.contains(['`', '-']) {
1429+
s = s.replace(['`', '-'], "¯");
14301430
}
14311431
(r, s, Some(span))
14321432
} else if let Some(((n, s), span)) = self.infinity().map(Into::into) {

src/format.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,12 +2044,14 @@ F,1
20442044
\\\\25cb
20452045
20462046
˜⊗
2047+
`5
20472048
";
20482049
let output = "\
20492050
F₁
20502051
20512052
˜⨂
20522053
2054+
¯5
20532055
";
20542056
let formatted = format_str(input, &FormatConfig::default()).unwrap().output;
20552057
assert_eq!(formatted, output);

0 commit comments

Comments
 (0)