-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ribosome-Impl.sublime-syntax
71 lines (59 loc) · 2 KB
/
Ribosome-Impl.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
%YAML 1.2
---
name: 'Ribosome ({language})'
scope: 'source.{extension}.dna'
first_line_match: ".*(ribosome\\.{extension}).*"
file_extensions: ['{extension}.dna', 'dna.{extension}']
contexts:
main:
- match: ""
push: 'scope:source.{langcontext}'
with_prototype:
- match: ^\s*\.+
comment: Ribosome (possibly with indentation and nested embedded expressions)
scope: 'meta.preprocessor.{extension}.dna'
set: ribosome_line
ribosome_line:
- match: \$?$
comment: End of line
scope: 'punctuation.terminator.{extension}.dna'
pop: true
- match: "(?<=\\.)/[+=]"
comment: Ribosome line operator or command
scope: 'keyword.operator.{extension}.dna punctuation.definition.keyword.{extension}.dna'
- match: "/!"
comment: Ribosome command
scope: 'keyword.operator.word.{extension}.dna punctuation.definition.keyword.{extension}.dna'
set: line_operator
- match: "[@&][1-9]?(?={)"
comment: Embedded expression (possibly nested and/or whitespace-stripping)
scope: 'keyword.operator.{extension}.dna punctuation.definition.keyword.{extension}.dna'
push: at_expression
- match: .
scope: string
line_operator:
- match: "(?<=/!)(output|stdout|append|separate|tabsize|include)"
comment: One of the built-in Ribosome commands
scope: 'keyword.operator.word.{extension}.dna'
- match: \(
comment: Begin command argument
push: 'scope:source.{langcontext}'
with_prototype:
- match: (?=\))
comment: End command argument
pop: true
- match: \)
pop: true
at_expression:
- match: \{
comment: Beginning of the @expression
push: 'scope:source.{langcontext}'
with_prototype:
- match: "(at|amp|slash)"
comment: Some special escape sequences
scope: 'constant.character.escape.{extension}.dna'
- match: (?=\})
comment: End expression
pop: true
- match: \}
pop: true