forked from zyedidia/micro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrystal.yaml
68 lines (57 loc) · 1.86 KB
/
crystal.yaml
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
filetype: crystal
detect:
filename: "\\.cr$"
rules:
# Asciibetical list of reserved words
- statement: "\\b(BEGIN|END|abstract|alias|and|begin|break|case|class|def|defined\\?|do|else|elsif|end|ensure|enum|false|for|fun|if|in|include|lib|loop|macro|module|next|nil|not|of|or|pointerof|private|protected|raise|redo|require|rescue|retry|return|self|sizeof|spawn|struct|super|then|true|type|undef|union|uninitialized|unless|until|when|while|yield)\\b"
# Constants
- constant: "(\\$|@|@@)?\\b[A-Z]+[0-9A-Z_a-z]*"
- constant.number: "\\b[0-9]+\\b"
# Crystal "symbols"
- constant: "([ ]|^):[0-9A-Z_]+\\b"
# Some unique things we want to stand out
- constant: "\\b(__FILE__|__LINE__)\\b"
# Regular expressions
- constant: "/([^/]|(\\\\/))*/[iomx]*|%r\\{([^}]|(\\\\}))*\\}[iomx]*"
# Shell command expansion is in `backticks` or like %x{this}. These are
# "double-quotish" (to use a perlism).
- constant.string: "`[^`]*`|%x\\{[^}]*\\}"
- constant.string:
start: "`"
end: "`"
rules: []
- constant.string:
start: "%x\\{"
end: "\\}"
rules: []
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- symbol.brackets:
start: "#\\{"
end: "\\}"
rules:
- default: ".*"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment.bright:
start: "##"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- constant:
start: "<<-?'?EOT'?"
end: "^EOT"
rules: []