1
0
Fork 0
mirror of https://github.com/Reuh/sublime-anselme.git synced 2025-10-27 11:49:30 +00:00
sublime-anselme/Anselme.sublime-syntax
2019-08-17 18:05:00 +02:00

123 lines
3.1 KiB
YAML
Executable file

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Anselme
comment: "Anselme v0.10.0 syntax"
file_extensions:
- ans
- anselme
scope: source.anselme
variables:
identifier: '[^\{\}\§\>\<\(\)\~\+\-\*\/\%\=\!\&\|\:\^\,\@\s\.\#\"\d][^\{\}\§\>\<\(\)\~\+\-\*\/\%\=\!\&\|\:\^\,\@\s\.\#\"]*'
contexts:
main:
- match: ^\s*\(.*$
scope: comment.anselme
- match: ^\s*(§)(.*?)\((.*)\)$
captures:
1: keyword.control.anselme
2: entity.name.function.anselme
3: variable.parameter.anselme
- match: ^\s*(§)(.*)$
captures:
1: keyword.control.anselme
2: entity.name.function.anselme
- match: '^\s*>'
scope: keyword.control.conditional.anselme
push: text_formatting
- match: '^\s*[:=+\-*/%!&|]'
scope: keyword.operator.assignment.anselme
push: line_expression
- match: '^\s*~~?'
scope: keyword.control.conditional.anselme
push: line_expression
- match: '^\s*#'
scope: keyword.other.anselme
push: line_expression
- match: '^\s*@'
scope: keyword.control.anselme
push: line_expression
- match: '^\s*(?<!\n)(?![(§>:=+\-*/%!&|~\n@])'
push: text_formatting
text_formatting:
- meta_scope: markup.quote.anselme
- match: '\{'
scope: keyword.other.anselme
push: brace_expression
- match: '\\$'
scope: keyword.other.anselme
- include: decorable
- match: '\n'
pop: true
line_expression:
- include: expression
- include: decorable
- match: '\n'
pop: true
decorable:
- match: '~'
scope: keyword.control.conditional.anselme
set: line_expression
- match: '#'
scope: keyword.other.anselme
set: line_expression
- match: '(§)([^\~\#\§\n]*)'
captures:
1: keyword.control.anselme
2: entity.name.function.anselme
set: line_expression
expression:
- meta_scope: meta.group.anselme
- match: '[|&!]'
scope: keyword.operator.logical.anselme
- match: '[+\-*/%^<>=]'
scope: keyword.operator.arithmetic.anselme
- match: '[:,]'
scope: keyword.operator.anselme
- match: \d*\.\d+
scope: constant.numeric.float.anselme
- match: \d+
scope: constant.numeric.integer.anselme
- match: \"
scope: punctuation.definition.string.begin
push: string
- match: '({{identifier}})(\()'
captures:
1: variable.function.anselme
2: keyword.other.anselme
push: arguments
- match: '\('
scope: keyword.other.anselme
push: parenthesis_expression
- match: '{{identifier}}'
scope: variable.other.anselme
parenthesis_expression:
- include: expression
- match: '\)'
scope: keyword.other.anselme
pop: true
brace_expression:
- include: expression
- match: '\}'
scope: keyword.other.anselme
pop: true
string:
- meta_scope: string.quoted.double
- match: \"
scope: punctuation.definition.string.end
pop: true
arguments:
- include: parenthesis_expression
- meta_content_scope: variable.parameter.anselme
- match: ','
scope: punctuation.separator.anselme