-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathswift.yaml
51 lines (40 loc) · 1.21 KB
/
swift.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
filetype: swift
detect:
filename: "\\.swift$"
rules:
# Operators
- statement: "([.:;,+*|=!?\\%]|<|>|/|-|&)"
# Statements
- statement: "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\\ "
- statement: "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\\ "
# Keywords
- statement: "(print)"
- statement: "(init)"
# Numbers
- constant.number: "([0-9]+)"
# Standard Types
- type: "\\ ((U)?Int(8|16|32|64))"
- constant: "(true|false|nil)"
- type: "\\ (Double|String|Float|Boolean|Dictionary|Array|Int)"
- type: "\\ (AnyObject)"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "///"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "/\\*\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"