mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 02:08:17 +00:00
fix: parse dot operation on atomic expression correctly (#497)
This commit is contained in:
parent
fb0a300bc2
commit
11f9965c48
3 changed files with 24 additions and 1 deletions
|
@ -311,7 +311,8 @@ const enterExpression = (kind: string, seek: RegExp): textmate.Pattern => {
|
|||
return {
|
||||
/// name: 'markup.expr.typst'
|
||||
begin: new RegExp("#" + seek.source),
|
||||
end: /(?<=;)|(?<=[\)\]\}])(?![;\(\[\$])|(?=[\s\}\]\)\$]|$)|(;)/,
|
||||
// `?=(?<![\d#])\.[^\p{XID_Start}_]`: This means that we are on a dot and the next character is not a valid identifier start, but we are not at the beginning of hash or number
|
||||
end: /(?<=;)|(?<=[\)\]\}])(?![;\(\[\$])|(?=(?<![#\d])\.[^\p{XID_Start}_])|(?=[\s\}\]\)\$]|$)|(;)/u,
|
||||
beginCaptures: {
|
||||
"0": {
|
||||
name: kind,
|
||||
|
|
2
syntaxes/textmate/tests/unit/bugs/tinymist-issue492.typ
Normal file
2
syntaxes/textmate/tests/unit/bugs/tinymist-issue492.typ
Normal file
|
@ -0,0 +1,2 @@
|
|||
"#spec_char.d8." For example
|
||||
"#spec_char.d8.a" For example
|
20
syntaxes/textmate/tests/unit/bugs/tinymist-issue492.typ.snap
Normal file
20
syntaxes/textmate/tests/unit/bugs/tinymist-issue492.typ.snap
Normal file
|
@ -0,0 +1,20 @@
|
|||
>"#spec_char.d8." For example
|
||||
#^ source.typst
|
||||
# ^ source.typst variable.other.readwrite.hash.typst
|
||||
# ^^^^^^^^^ source.typst variable.other.readwrite.typst
|
||||
# ^ source.typst keyword.operator.accessor.typst
|
||||
# ^^ source.typst variable.other.readwrite.typst
|
||||
# ^ source.typst keyword.operator.accessor.typst
|
||||
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||
# ^^^^^^^^^^^^^ source.typst string.quoted.double.typst
|
||||
>"#spec_char.d8.a" For example
|
||||
#^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||
# ^ source.typst
|
||||
# ^^^^^^^^^ source.typst variable.other.readwrite.typst
|
||||
# ^ source.typst keyword.operator.accessor.typst
|
||||
# ^^ source.typst variable.other.readwrite.typst
|
||||
# ^ source.typst keyword.operator.accessor.typst
|
||||
# ^ source.typst variable.other.readwrite.typst
|
||||
# ^ source.typst string.quoted.double.typst punctuation.definition.string.typst
|
||||
# ^^^^^^^^^^^^^ source.typst string.quoted.double.typst
|
||||
>
|
Loading…
Add table
Add a link
Reference in a new issue