blackhole-theme-sublime/bibop-recipe.sublime-syntax

94 lines
2.4 KiB
YAML

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Bibop Recipe
file_extensions:
- recipe
scope: source.bibop
contexts:
main:
- include: comments
- include: strings
- include: keywords
- include: commands
- include: actions
- include: variables
comments:
- match: (?=^\s*#)
push:
- match: \#
scope: punctuation.definition.comment.bibop
set:
- meta_scope: comment.line.number-sign.bibop
- include: pop-on-line-end
- match: \#
scope: punctuation.definition.comment.bibop
push:
- meta_scope: comment.line.number-sign.bibop
- include: pop-on-line-end
pop-on-line-end:
- match: $
pop: true
strings:
- match: '"'
scope: punctuation.definition.string.begin.bibop
push:
- meta_scope: string.quoted.double.bibop
- match: '"'
scope: punctuation.definition.string.end.bibop
pop: true
- match: $
scope: punctuation.definition.string.end.bibop
pop: true
- include: variables
- match: "'"
scope: punctuation.definition.string.begin.bibop
push:
- meta_scope: string.quoted.single.bibop
- match: "'"
scope: punctuation.definition.string.end.bibop
pop: true
- match: $
scope: punctuation.definition.string.end.bibop
pop: true
keywords:
- match: '^(dir|require-root|unsafe-actions|fast-finish|lock-workdir|unbuffer|delay|https-skip-verify|pkg)'
scope: keyword.other
- match: '\b(true|false|yes|no)\b'
scope: constant.language
- match: '\b([0-9]+\.[0-9]*|\.[0-9]+)([eE][+-]?\d+)?\b'
scope: constant.numeric.float.decimal.bibop
- match: '\b\d+\b'
scope: constant.numeric.integer.decimal.bibop
commands:
- match: '^([+]?)(command):*([a-z0-9]*)'
captures:
0: support.function
1: bibop.command.group-sign
2: meta.function
3: meta.function.tag
actions:
- match: '^( |\t)[a-z-]+'
scope: bibop.action
- match: '^(?: |\t)(\!)([a-z-]+)'
captures:
1: bibop.action.negative-sign
2: bibop.action
variables:
- match: '^(var) +([\d\w\S]+)'
captures:
0: spec.definition
1: storage.type
2: entity.name.type
- match: '\{([a-zA-Z0-9_-]{1,})\}'
captures:
0: variable.other.bibop
1: variable.other.name.bibop