forked from nicolaschan/bell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschedules.sublime-syntax
78 lines (68 loc) · 1.61 KB
/
schedules.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
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: Bell Schedule File
file_extensions:
- bell
scope: source.bell
contexts:
main:
- include: header
- include: entry
header:
- match: '\*'
scope: keyword.control
push: headerString
headerString:
- match: Default Week
scope: storage.type
set: defaultWeek
- match: Special Days
scope: storage.type
set: specialDays
- match: '#'
scope: keyword.control
set: scheduleName
- match: '[a-zA-Z0-9\-]+'
scope: entity.name.class
set: expectHash
- match: \n
pop: true
expectHash:
- match: '#'
scope: keyword.control
set: scheduleName
- match: '\n'
pop: true
defaultWeek:
- match: Sun|Mon|Tue|Wed|Thu|Fri|Sat
scope: keyword.other
push: headerString
- match: \*
scope: keyword.control
set: headerString
specialDays:
- match: '[0-9]{2}/[0-9]{2}/[0-9]{4}-?[0-9]{0,2}/?[0-9]{0,2}/?[0-9]{0,4}'
scope: constant.numeric
push: headerString
scheduleName:
- meta_scope: string.quoted.other
- match: \n
pop: true
entry:
- match: '\b[0-9]{1,2}:[0-9]{2}\b'
scope: constant.numeric
push: entryName
entryName:
- match: '{'
scope: punctuation.separator
push: replaceString
- match: '.'
scope: string.quoted.other
- match: \n
pop: true
replaceString:
- meta_scope: variable.other.readwrite
- match: '}'
scope: punctuation.separator
pop: true