-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArturo + Built-in.sublime-syntax
193 lines (163 loc) · 6.15 KB
/
Arturo + Built-in.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
%YAML 1.2
---
file_extensions:
- art
scope: source.arturo
contexts:
########################
# MAIN
########################
main:
## COMMENTS
# She-bang line
- match: '#!'
scope: punctuation.definition.comment.arturo
push: line_comment
# Single-line comments
- match: ;
scope: punctuation.definition.comment.arturo
push: line_comment
### STRINGS
# Double-quoted string literals
- match: '"'
scope: string.quoted.double.arturo
push: double_quoted_string
# FullLine strings
- match: «
scope: keyword.operator.arturo
push: fullline_string
# Curly strings
- match: '{'
scope: text.plain.arturo
push: curly_string
# Triple-dash strings
- match: '---'
scope: string.quoted.double.arturo
push: triple_dash_string
### LITERALS
# numbers
- match: '[0-9]+(\.[0-9]+)?'
scope: text.plain.arturo
# characters
- match: '`.`'
scope: string.quoted.double.arturo
# boolean
- match: 'true|false'
scope: constant.language.arturo
# boolean
- match: 'null'
scope: constant.language.arturo
### SYMBOLS
# syntactic sugar
- match: '(->|=>|\|)'
scope: markup.heading.arturo punctuation.definition.heading.arturo
# operators
- match: '@|#|\+|\||\*|\$|\-|\%|\/|\.\.|\^|~|=|<|>|\\|\-\-\-'
scope: keyword.operator.arturo
### LABELS
# attributes
- match: '\.([\w]+\b\??:?)'
scope: text.plain.arturo
# label
- match: '([\w]+\b?:)'
scope: entity.name.arturo
### BUILT-IN FUNCTIONS
- match: '\b(abs|acos|acosh|add|all|and|and|any|append|array|as|asin|asinh|atan|atanh|attr|attr|attrs|average|benchmark|call|capitalize|case|clear|color|combine|cos|cosh|csec|csech|ctan|ctanh|dec|decode|dictionary|div|do|download|drop|dup|else|empty|empty|encode|equal|even|execute|exists|exit|factors|fdiv|filter|first|flatten|fold|function|gcd|get|globalize|greater|greaterOrEqual|hash|help|if|if|in|in|inc|index|info|input|inspect|is|join|key|keys|last|less|lessOrEqual|let|levenshtein|list|loop|lower|lower|mail|map|match|max|median|min|mod|module|mul|nand|nand|neg|negative|new|nop|nor|nor|not|not|notEqual|now|numeric|odd|or|or|pad|panic|pause|permutate|pop|positive|pow|prefix|prefix|prime|print|prints|product|push|random|range|read|relative|remove|render|repeat|replace|return|reverse|sample|sec|sech|select|serve|set|set|shl|shr|shuffle|sin|sinh|size|slice|sort|split|sqrt|stack|strip|sub|suffix|suffix|sum|swap|symbols|take|tan|tanh|to|try|try|type|unique|until|upper|upper|values|var|webview*|when|while|whitespace|write|xnor|xnor|xor|xor|zero)(\?|\b)'
scope: variable.function.arturo
########################
# SUBSCOPES
########################
line_comment:
- meta_scope: comment.line.arturo
- match: $
pop: true
double_quoted_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.arturo
- match: '\\.'
scope: constant.character.escape.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
push:
- clear_scopes: true
- meta_scope: source.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
pop: true
- include: 'main'
- match: '"'
scope: string.quoted.double.arturo
pop: true
- include: escaped
fullline_string:
- meta_scope: markup.heading.arturo
- match: $
pop: true
curly_string:
- meta_include_prototype: false
- meta_scope: text.plain.arturo
- match: '\\.'
scope: constant.character.escape.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
push:
- clear_scopes: true
- meta_scope: source.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
pop: true
- include: 'main'
- match: '!html'
scope: markup.heading.arturo punctuation.definition.heading.arturo
push: Packages/HTML/HTML.sublime-syntax
with_prototype:
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
push:
- clear_scopes: true
- meta_scope: source.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
pop: true
- include: 'main'
- match: 'html!'
scope: markup.heading.arturo punctuation.definition.heading.arturo
pop: true
- match: '!latex'
scope: markup.heading.arturo punctuation.definition.heading.arturo
push: Packages/LaTeX/TeX.sublime-syntax
with_prototype:
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
push:
- clear_scopes: true
- meta_scope: source.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
pop: true
- include: 'main'
- match: 'latex!'
scope: markup.heading.arturo punctuation.definition.heading.arturo
pop: true
- match: '}'
scope: text.plain.arturo
pop: true
- include: escaped
triple_dash_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.arturo
- match: '\\.'
scope: constant.character.escape.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
push:
- clear_scopes: true
- meta_scope: source.arturo
- match: '\|'
scope: markup.heading.arturo punctuation.definition.heading.arturo
pop: true
- include: 'main'
- match: '---'
scope: string.quoted.double.arturo
pop: true
- include: escaped