summaryrefslogtreecommitdiff
path: root/crates/typst-syntax/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-syntax/src/parser.rs')
-rw-r--r--crates/typst-syntax/src/parser.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/typst-syntax/src/parser.rs b/crates/typst-syntax/src/parser.rs
index e187212d..c5d13c8b 100644
--- a/crates/typst-syntax/src/parser.rs
+++ b/crates/typst-syntax/src/parser.rs
@@ -271,10 +271,11 @@ fn math_expr_prec(p: &mut Parser, min_prec: usize, stop: SyntaxKind) {
}
SyntaxKind::Text | SyntaxKind::MathText | SyntaxKind::MathShorthand => {
- continuable = matches!(
- math_class(p.current_text()),
- None | Some(MathClass::Alphabetic)
- );
+ continuable = !p.at(SyntaxKind::MathShorthand)
+ && matches!(
+ math_class(p.current_text()),
+ None | Some(MathClass::Alphabetic)
+ );
if !maybe_delimited(p) {
p.eat();
}