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

Added § decorator

This commit is contained in:
Étienne Fildadut 2019-08-17 18:05:00 +02:00
parent 732ca7f6c5
commit 516e3ea156
3 changed files with 52 additions and 14 deletions

View file

@ -9,7 +9,7 @@ file_extensions:
scope: source.anselme scope: source.anselme
variables: variables:
identifier: '[^\{\}\§\>\<\(\)\~\+\-\*\/\%\=\!\&\|\:\^\,\@\s\%\.\"\d][^\{\}\§\>\<\(\)\~\+\-\*\/\%\=\!\&\|\:\^\,\@\s\%\.\"]*' identifier: '[^\{\}\§\>\<\(\)\~\+\-\*\/\%\=\!\&\|\:\^\,\@\s\.\#\"\d][^\{\}\§\>\<\(\)\~\+\-\*\/\%\=\!\&\|\:\^\,\@\s\.\#\"]*'
contexts: contexts:
main: main:
@ -49,14 +49,28 @@ contexts:
push: brace_expression push: brace_expression
- match: '\\$' - match: '\\$'
scope: keyword.other.anselme scope: keyword.other.anselme
- include: decorable
- match: '\n'
pop: true
line_expression:
- include: expression
- include: decorable
- match: '\n'
pop: true
decorable:
- match: '~' - match: '~'
scope: keyword.control.conditional.anselme scope: keyword.control.conditional.anselme
set: line_expression set: line_expression
- match: '#' - match: '#'
scope: keyword.other.anselme scope: keyword.other.anselme
set: line_expression set: line_expression
- match: '\n' - match: '(§)([^\~\#\§\n]*)'
pop: true captures:
1: keyword.control.anselme
2: entity.name.function.anselme
set: line_expression
expression: expression:
- meta_scope: meta.group.anselme - meta_scope: meta.group.anselme
@ -83,8 +97,6 @@ contexts:
push: parenthesis_expression push: parenthesis_expression
- match: '{{identifier}}' - match: '{{identifier}}'
scope: variable.other.anselme scope: variable.other.anselme
- match: '\n'
pop: true
parenthesis_expression: parenthesis_expression:
- include: expression - include: expression
@ -98,15 +110,6 @@ contexts:
scope: keyword.other.anselme scope: keyword.other.anselme
pop: true pop: true
line_expression:
- include: expression
- match: '~'
scope: keyword.control.conditional.anselme
set: line_expression
- match: '#'
scope: keyword.other.anselme
set: line_expression
string: string:
- meta_scope: string.quoted.double - meta_scope: string.quoted.double
- match: \" - match: \"

21
Comments.tmPreferences Normal file
View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.anselme</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>(</string>
</dict>
</array>
</dict>
</dict>
</plist>

14
Indent.tmPreferences Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Indent</string>
<key>scope</key>
<string>source.anselme</string>
<key>settings</key>
<dict>
<key>increaseIndentPattern</key>
<string>^\s*[§>~#]</string>
</dict>
</dict>
</plist>