From ececd074248a93d16fae08aeb596e89ff6e04814 Mon Sep 17 00:00:00 2001 From: bluebear94 Date: Tue, 20 Jun 2023 10:59:42 -0400 Subject: Make factorial take precedence over fraction in math expressions (#1487) Fixes #1475. --- src/syntax/parser.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/syntax/parser.rs b/src/syntax/parser.rs index 5fc9ec26..7d057ab9 100644 --- a/src/syntax/parser.rs +++ b/src/syntax/parser.rs @@ -307,6 +307,12 @@ fn math_expr_prec(p: &mut Parser, min_prec: usize, stop: SyntaxKind) { } while !p.eof() && !p.at(stop) { + if p.directly_at(SyntaxKind::Text) && p.current_text() == "!" { + p.eat(); + p.wrap(m, SyntaxKind::Math); + continue; + } + let Some((kind, stop, assoc, mut prec)) = math_op(p.current()) else { break; }; -- cgit v1.2.3