diff options
| author | Alex Saveau <saveau.alexandre@gmail.com> | 2023-06-09 02:36:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-09 11:36:44 +0200 |
| commit | 635ef03273792a07e6f227a17b30d3f93c6a1216 (patch) | |
| tree | 51a118387abb5ac9e25306c4a09011f13a78b894 | |
| parent | 735e810825ed05639cdba6818debf21f18482141 (diff) | |
Treat function-looking code in attachment as function (#985)
| -rw-r--r-- | src/syntax/parser.rs | 4 | ||||
| -rw-r--r-- | tests/ref/compiler/highlight.png | bin | 81677 -> 70314 bytes | |||
| -rw-r--r-- | tests/ref/math/attach.png | bin | 27297 -> 26810 bytes | |||
| -rw-r--r-- | tests/typ/math/attach.typ | 4 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/syntax/parser.rs b/src/syntax/parser.rs index 3b82ce16..05db42e1 100644 --- a/src/syntax/parser.rs +++ b/src/syntax/parser.rs @@ -412,10 +412,10 @@ fn math_class(text: &str) -> Option<MathClass> { fn math_op(kind: SyntaxKind) -> Option<(SyntaxKind, SyntaxKind, ast::Assoc, usize)> { match kind { SyntaxKind::Underscore => { - Some((SyntaxKind::MathAttach, SyntaxKind::Hat, ast::Assoc::Right, 3)) + Some((SyntaxKind::MathAttach, SyntaxKind::Hat, ast::Assoc::Right, 2)) } SyntaxKind::Hat => { - Some((SyntaxKind::MathAttach, SyntaxKind::Underscore, ast::Assoc::Right, 3)) + Some((SyntaxKind::MathAttach, SyntaxKind::Underscore, ast::Assoc::Right, 2)) } SyntaxKind::Slash => { Some((SyntaxKind::MathFrac, SyntaxKind::Eof, ast::Assoc::Left, 1)) diff --git a/tests/ref/compiler/highlight.png b/tests/ref/compiler/highlight.png Binary files differindex 7f69fd6b..ccbbc056 100644 --- a/tests/ref/compiler/highlight.png +++ b/tests/ref/compiler/highlight.png diff --git a/tests/ref/math/attach.png b/tests/ref/math/attach.png Binary files differindex 9a32b64c..ab93f25b 100644 --- a/tests/ref/math/attach.png +++ b/tests/ref/math/attach.png diff --git a/tests/typ/math/attach.typ b/tests/typ/math/attach.typ index 3a498686..f5f49627 100644 --- a/tests/typ/math/attach.typ +++ b/tests/typ/math/attach.typ @@ -43,8 +43,8 @@ $ --- // Test function call after subscript. -$pi_1(Y), a_f(x), a^zeta(x) \ - a^subset.eq(x), a_(zeta(x)), pi_(1(Y))$ +$pi_1(Y), a_f(x), a^zeta (x), a^abs(b)_sqrt(c) \ + a^subset.eq (x), a_(zeta(x)), pi_(1(Y)), a^(abs(b))_(sqrt(c))$ --- // Test associativity and scaling. |
