-
Notifications
You must be signed in to change notification settings - Fork 3
/
arrow.sublime-syntax
81 lines (72 loc) · 1.78 KB
/
arrow.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
%YAML 1.2
---
name: Arrow
file_extensions: [ar]
scope: source.ar
variables:
identifier: \b[[:alpha:]_][[:alnum:]_]*\b # upper and lowercase
contexts:
main:
- match: \b(if|elseif|else|for|while|matches|in|start|break|return|exit|repeat|pod)\b
scope: keyword.control.flow.arrow
- match: "^\\s*(fn)\\s*\\b({{identifier}})\\b"
captures:
1: keyword.arrow
2: entity.name.function.arrow
- match: \b([0-9]+)((.[0-9]+)?)\b
scope: constant.numeric.arrow
- match: \b(true|false)\b
scope: constant.boolean.arrow
- match: \[
push: list
- match: \]
scope: invalid.illegal.stray-bracket-end
- match: \(
scope: punctuation.section.brackets.begin.arrow
push: brackets
- match: \)
scope: invalid.illegal.stray-bracket-end
- match: \{
push: curly
- match: \}
scope: invalid.illegal.stray-bracket-end
- match: ;;;
scope: punctuation.definition.comment.arrow
push: comments
- match: '"'
push: string
- match: ''''
push: char
brackets:
- meta_scope: meta.group.arrow
- match: \)
scope: punctuation.section.brackets.end.arrow
pop: true
- include: main
list:
- match: \]
pop: true
- include: main
curly:
- match: \}
pop: true
- include: main
string:
- meta_scope: string.quoted.double.arrow
- match: \\.
scope: constant.character.escape.arrow
- match: '"'
pop: true
char:
- meta_scope: string.quoted.single.arrow
- match: \\.
scope: constant.character.escape.arrow
- match: ''''
pop: true
comments:
- meta_scope: comment.line.arrow
- match: '(\\)$\n'
captures:
1: punctuation.separator.continuation.arrow
- match: \n
pop: true