diff options
| author | bluebear94 <uruwi@protonmail.com> | 2023-06-20 10:59:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-20 16:59:42 +0200 |
| commit | ececd074248a93d16fae08aeb596e89ff6e04814 (patch) | |
| tree | 44902d6ddb1210e74b199d351017d348f70b26d3 /src | |
| parent | 8513c2b0fb2275e5d14ea4efa77e38e026b4a920 (diff) | |
Make factorial take precedence over fraction in math expressions (#1487)
Fixes #1475.
Diffstat (limited to 'src')
| -rw-r--r-- | src/syntax/parser.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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; }; |
