-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathedge.sublime-syntax
105 lines (94 loc) · 2.55 KB
/
edge.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
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- edge
scope: text.html.edge
contexts:
main:
- match: ""
push: "Packages/HTML/HTML.sublime-syntax"
with_prototype:
# Escaped mustache block
- match: "(@{{2,3})"
captures:
0: comment.block
push: escapedTag
# Comment
- match: "({{--)"
captures:
0: comment.block
push: comment
# Safe mustache block
- match: "({{{)"
captures:
0: punctuation.definition.safetag.braces.start.edge
push: safeMustache
# Mustache block
- match: "({{)"
captures:
0: punctuation.definition.tag.braces.start.edge
push: mustache
# Non seekable tag
- match: ^(\s*)((@{1,2})(!)?([a-zA-Z._]+))(~)?$
captures:
2: entity.name.function.edge.end
# Seekable tag
- match: ^(\s*)((@{1,2})(!)?([a-zA-Z._]+)(\s{0,2}))(?=\()
captures:
2: entity.name.function.edge
push: tag
# End of escaped mustache block
escapedTag:
- match: "(}{2,3})"
captures:
0: comment.block
pop: true
- meta_scope: comment.block
# End of comment block
comment:
- match: "(--}})"
captures:
0: comment.block
pop: true
- meta_scope: comment.block
# Process tag contents as Javascript
tag:
- match: \(
scope: punctuation.section.arguments.begin.edge
set: tag-body
- match: (?!\s*\()
pop: 1
tag-body:
- match: \)
scope: punctuation.section.arguments.end.edge
pop: true
- include: "Packages/JavaScript/JavaScript.sublime-syntax#expression"
# Process safe mustache contents as Javascript
safeMustache:
- match: "(}}})"
captures:
0: punctuation.definition.safetag.braces.end.edge
pop: true
- match: ""
push: "Packages/JavaScript/JavaScript.sublime-syntax#expression"
set:
- match: "}}}"
scope: punctuation.definition.safetag.braces.end.edge
with_prototype:
- match: "(?=}}})"
pop: true
# Process mustache contents as Javascript
mustache:
- match: "(}})"
captures:
0: punctuation.definition.tag.braces.end.edge
pop: true
- match: ""
push: "Packages/JavaScript/JavaScript.sublime-syntax#expression"
set:
- match: "}}"
scope: punctuation.definition.tag.braces.end.edge
with_prototype:
- match: "(?=}})"
pop: true