mirror of
https://github.com/typst/typst
synced 2025-05-23 05:25:28 +08:00
Treat function-looking code in attachment as function (#985)
This commit is contained in:
parent
735e810825
commit
635ef03273
@ -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))
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 69 KiB |
Binary file not shown.
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 26 KiB |
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user