-
Notifications
You must be signed in to change notification settings - Fork 0
/
views.sublime-syntax
53 lines (47 loc) · 1.16 KB
/
views.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
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Views
file_extensions: [view, blocks]
scope: source.view
contexts:
main:
# block name
- match: "^\\s*([A-Z][a-zA-Z0-9]*\\s*)$"
scope: entity.name.block.views
- match: "^\\s*([A-Z][a-zA-Z0-9]*)\\s+[a-z]*\\s*.+$"
captures:
1: entity.name.block.views
## user comment
- match: '^\\s*##.+$'
scope: 'userComment.views'
# comment
- match: "^\\s*#.+$"
scope: comment.views
# when
- match: "^\\s*when.+$"
scope: variable.function.code.views
# onWhen
- match: "^\\s*onWhen.+$"
scope: onWhen.views
# code
- match: "^\\s*[a-z][a-zA-Z0-9]*\\s*"
push: code
code:
# slots w/ default value
- match: "(<[a-z][a-zA-Z0-9]*)?\\ +(s*(.+)$)"
pop: true
captures:
1: variable.function.code.views
2: string.value.views
# slots
- match: "<([a-z][a-zA-Z0-9]*)?"
pop: true
scope: variable.function.code.views
# item
- match: ".*item.*$"
pop: true
scope: variable.function.item.code.views
- match: ".+$"
pop: true
scope: string.value.views