-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: parse math parentheses after
[_^\/√∛∜]
(#1106)
* test: move math syntax highlight tests * feat: parse math parentheses after `_` and `^` * feat: all opening/closing kinds * dev: more kinds
- Loading branch information
1 parent
d4ba43c
commit 626efa0
Showing
16 changed files
with
209 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
syntaxes/textmate/tests/unit/bugs/tinymist-issue194.typ.snap
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
// issue 194 | ||
$ x^"#" = "argmin"_(A x=b) ||x||_(cal(l)_2) $ | ||
|
||
$ x^"#" = "argmin"_(A x=b()) ||x||_(cal(l)_2) $ |
30 changes: 30 additions & 0 deletions
30
syntaxes/textmate/tests/unit/math/bracket-issue194.typ.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
> | ||
>// issue 194 | ||
#^^ source.typst comment.line.double-slash.typst punctuation.definition.comment.typst | ||
# ^^^^^^^^^^ source.typst comment.line.double-slash.typst | ||
>$ x^"#" = "argmin"_(A x=b) ||x||_(cal(l)_2) $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^^^^^^ source.typst markup.math.typst string.quoted.double.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ x^"#" = "argmin"_(A x=b()) ||x||_(cal(l)_2) $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^^^^^^ source.typst markup.math.typst string.quoted.double.typst | ||
# ^ source.typst markup.math.typst string.quoted.double.typst punctuation.definition.string.typst | ||
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
$ ||x||_[] $ | ||
|
||
$ ||x||_[) $ | ||
|
||
$ ||x||_⧼) $ | ||
|
||
$ 1 / () $ | ||
|
||
$ √() $ | ||
|
||
$ ∛() $ | ||
|
||
$ ∛∜() $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
> | ||
>$ ||x||_[] $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ||x||_[) $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ||x||_⧼) $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ 1 / () $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ √() $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ∛() $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ∛∜() $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$ ||x||_(cal(l)_2() $ | ||
|
||
$ ||x||_) $ | ||
|
||
$ ||x||_[ $ | ||
|
||
$ ||x||_[ $ | ||
|
||
$ ||x||_⧼ $ | ||
|
||
$ ||x||_) $ |
30 changes: 30 additions & 0 deletions
30
syntaxes/textmate/tests/unit/math/bracket_unmatch.typ.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
>$ ||x||_(cal(l)_2() $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^^^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ||x||_) $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ||x||_[ $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ||x||_[ $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ||x||_⧼ $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> | ||
>$ ||x||_) $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^^^^^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$\$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
>$\$$ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^ source.typst markup.math.typst constant.character.escape.content.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ a #[$b$] $ |
12 changes: 12 additions & 0 deletions
12
syntaxes/textmate/tests/unit/math/dollar_in_dollar.typ.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
>$ a #[$b$] $ | ||
#^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^^^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst keyword.control.hash.typst | ||
# ^ source.typst markup.math.typst meta.brace.square.typst | ||
# ^ source.typst markup.math.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^ source.typst markup.math.typst markup.math.typst | ||
# ^ source.typst markup.math.typst markup.math.typst punctuation.definition.string.math.typst | ||
# ^ source.typst markup.math.typst meta.brace.square.typst | ||
# ^ source.typst markup.math.typst | ||
# ^ source.typst markup.math.typst punctuation.definition.string.math.typst | ||
> |
File renamed without changes.