summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorIan Wrzesinski <133046678+wrzian@users.noreply.github.com>2025-04-02 05:30:04 -0400
committerGitHub <noreply@github.com>2025-04-02 09:30:04 +0000
commit12699eb7f415bdba6797c84e3e7bf44dde75bdf9 (patch)
treea0fa17865317b697c469bd0cfee9814f7adada53 /crates
parent96dd67e011bb317cf78683bcf1edfdfca5e7b6b3 (diff)
Parse multi-character numbers consistently in math (#5996)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates')
-rw-r--r--crates/typst-syntax/src/parser.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/typst-syntax/src/parser.rs b/crates/typst-syntax/src/parser.rs
index c5d13c8b..ecd0d78a 100644
--- a/crates/typst-syntax/src/parser.rs
+++ b/crates/typst-syntax/src/parser.rs
@@ -271,11 +271,9 @@ fn math_expr_prec(p: &mut Parser, min_prec: usize, stop: SyntaxKind) {
}
SyntaxKind::Text | SyntaxKind::MathText | SyntaxKind::MathShorthand => {
- continuable = !p.at(SyntaxKind::MathShorthand)
- && matches!(
- math_class(p.current_text()),
- None | Some(MathClass::Alphabetic)
- );
+ // `a(b)/c` parses as `(a(b))/c` if `a` is continuable.
+ continuable = math_class(p.current_text()) == Some(MathClass::Alphabetic)
+ || p.current_text().chars().all(char::is_alphabetic);
if !maybe_delimited(p) {
p.eat();
}