1
0
Fork 0
mirror of https://github.com/Reuh/sublime-anselme.git synced 2025-10-27 19:59:30 +00:00

Update to latest Anselme version

This commit is contained in:
Étienne Fildadut 2024-05-20 15:10:16 +02:00
parent 13408c49d9
commit b313536643

View file

@ -14,28 +14,40 @@ variables:
[^0-9\s\'{{identifier_disallowed}}][^{{identifier_disallowed}}]*
|\_( \! | \- | \* | \~ )
|( \! )\_
|\_( \|\> | \+ | \- | \/ | \/\/ | \* | \^ | \% | \& | \| | \=\= | \= | \!\= | \>\= | \<\= | \< | \> | \. | \:\: | \# | \: )\_
|\_( \+ | \- | \/ | \/\/ | \* | \^ | \% | \& | \| | \=\= | \= | \!\= | \>\= | \<\= | \< | \> | \. | \:\: | \# | \: )\_
)
contexts:
prototype:
- match: '\/\*'
scope: comment.line.anselme punctuation.definition.comment.anselme
push: comment
- match: '\s+'
- include: comments_and_whitespace
- match: '$'
pop: true
comments_and_whitespace:
- match: '\/\/'
scope: comment.line.anselme punctuation.definition.comment.anselme
push: comment
- match: '\/\*'
scope: comment.block.anselme punctuation.definition.comment.anselme
push: multiline_comment
- match: '\s+'
main:
- match: ''
push: primary
comment:
- meta_scope: comment.line.anselme
- match: '\/\/|$'
scope: punctuation.definition.comment.anselme
pop: true
multiline_comment:
- meta_scope: comment.block.anselme
- match: '\/\*'
scope: punctuation.definition.comment.anselme
push: comment
- match: '\*\/|$'
push: multiline_comment
- match: '\*\/'
scope: punctuation.definition.comment.anselme
pop: true
@ -54,7 +66,7 @@ contexts:
- match: '\('
scope: punctuation.section.parens.begin.anselme
push: parenthesis
- match: '\::?&?@?\$'
- match: '\:&?@?\$'
scope: keyword.declaration.anselme
push: function_definition
- match: '(\#)({{identifier}})'
@ -62,17 +74,23 @@ contexts:
1: keyword.declaration.anselme
2: entity.name.label.anselme
push: secondary
- match: '(\::?&?@?)({{identifier}})'
- match: '(\:&?@?)({{identifier}})'
captures:
1: keyword.declaration.anselme
2: variable.other.anselme
push: secondary
- match: '{{identifier}}(?=\!(?!\s*{{identifier}})|\()'
- match: '{{identifier}}(?=\!(?!\s*{{identifier}})|\(|\[|\{)'
scope: variable.function.anselme
set: secondary
- match: '({{identifier}})\s*(?=\:)'
scope: meta.mapping.key.anselme string.unquoted.key.anselme
push: secondary
- match: '{{identifier}}'
scope: variable.other.anselme
push: secondary
- match: '\-\-\-'
scope: text.anselme meta.separator.thematic-break.anselme punctuation.definition.thematic-break.anselme
push: secondary
- match: '\_'
scope: variable.language.anselme
push: secondary
@ -98,7 +116,7 @@ contexts:
- match: '\;'
scope: keyword.control.anselme
set: primary
- match: '\-'
- match: '\-|\+'
scope: keyword.operator.arithmetic.anselme
set: primary
- match: '\!'
@ -159,6 +177,7 @@ contexts:
scope: constant.character.escape.anselme
string:
- meta_include_prototype: false
- meta_scope: meta.string.anselme string.quoted.double.anselme
- include: expression_interpolation
- include: character_escape
@ -177,14 +196,18 @@ contexts:
## Other primary elements ##
parenthesis:
- meta_include_prototype: false
- meta_scope: meta.parens.anselme
- match: '\)'
scope: punctuation.section.parens.end.anselme
set: secondary
- include: comments_and_whitespace
- include: primary
tuple:
- meta_include_prototype: false
- meta_scope: meta.sequence.tuple.anselme
- include: comments_and_whitespace
- include: primary
- match: '\,'
scope: punctuation.separator.sequence.anselme
@ -193,7 +216,9 @@ contexts:
set: secondary
struct:
- meta_include_prototype: false
- meta_scope: meta.mapping.anselme
- include: comments_and_whitespace
- include: primary
- match: '\,'
scope: punctuation.separator.sequence.anselme
@ -210,9 +235,6 @@ contexts:
- match: '\,'
scope: punctuation.separator.sequence.anselme
push: primary
- match: '\|\>'
scope: keyword.control.conditional.anselme
push: primary
- match: '\#|\:\:|\:|\-\>'
scope: keyword.operator.anselme
push: primary
@ -222,7 +244,7 @@ contexts:
- match: '\=\=|\!\=|\<\=|\>\=|\<|\>'
scope: keyword.operator.comparison.anselme
push: primary
- match: '\+|\-|\*|\/\/|\/|\%|\^'
- match: '\+|\-|\*|\/|\%|\^'
scope: keyword.operator.arithmetic.anselme
push: primary
- match: '\.'