-
Notifications
You must be signed in to change notification settings - Fork 2
/
QL.sublime-syntax
84 lines (77 loc) · 2.16 KB
/
QL.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
%YAML 1.2
---
name: QL
file_extensions: [ql,qll]
scope: source.QL
contexts:
main:
- match: \b(import)[ ]
scope: keyword.other
push: qualid
- match: \b(boolean|date|float|int|string)\b
scope: storage.type
- match: \b(@[a-z][a-zA-Z0-9_]*)\b
scope: support.type
- match: \b(or|and|not|implies|if|then|else|=|!=|<|>|<=|>=|instanceof|+|-|*|/|%)\b
scope: keyword.operator
- match: \b(false|true)\b
scope: constant.language
- match: \b(this|result|super)\b
scope: variable.language
- match: '"'
push: string
- match: '//'
scope: punctuation.definition.comment
push: line_comment
- match: '/\*'
scope: punctuation.definition.comment
push: block_comment
- match: '(abstract|cache|external|final|library|noopt|private|deprecated)'
scope: storage.modifier
- match: \b(any|exists|forall|forex|none)\b
scope: keyword.quantifier
- match: \b(as|class|extends|from|import|in|module|newtype|predicate)\b
scope: keyword.other
- match: \b(asc|by|desc|order)\b
scope: keyword.order
- match: \b(avg|concat|count|max|min|rank|strictconcat|strictcount|strictsum|sum)\b
scope: keyword.aggregate
- match: \b(select|where)\b
scope: keyword.query
- match: \b_\b
scope: variable.language.dont-care.ql
- match: '::'
scope: punctuation.accessor
- match: '\b[0-9A-Za-z_]\b'
scope: variable.id_character
# Add highlight mismatching brackets
- match: \(\{
push: brackets
- match: \)\}
scope: invalid.illegal.stray-bracket-end
brackets:
- match: \)\}
pop: true
- include: main
qualid:
- meta_scope: meta.qualid
- match: '[a-zA-Z0-9_.]'
- match: (.|\n)
pop: true
string:
- meta_scope: string.quoted.double
- match: '\\(\\|"|n|r|t)'
scope: constant.character.escape
- match: '(\\|\n|\t|\r)'
scope: invalid.illegal
- match: '"'
pop: true
line_comment:
- meta_scope: comment.line
- match: $
pop: true
block_comment:
- meta_scope: comment.block
- match: '\*/'
scope: punctuation.definition.comment
pop: true