]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/swift.yaml
Merge branch 'view-refactor'
[micro.git] / runtime / syntax / swift.yaml
1 filetype: swift
2
3 detect:
4     filename: "\\.swift$"
5
6 rules:
7     # Operators
8     - statement: "([.:;,+*|=!?\\%]|<|>|/|-|&)"
9
10       # Statements
11     - statement:  "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\\ "
12     - statement:  "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\\ "
13
14       # Keywords
15     - statement: "(print)"
16     - statement: "(init)"
17
18       # Numbers
19     - constant.number: "([0-9]+)"
20
21       # Standard Types
22     - type: "\\ ((U)?Int(8|16|32|64))"
23     - constant: "(true|false|nil)"
24     - type: "\\ (Double|String|Float|Boolean|Dictionary|Array|Int)"
25     - type: "\\ (AnyObject)"
26
27     - constant.string:
28         start: "\""
29         end: "(?<!\\\\)\""
30         rules:
31             - constant.specialChar: "\\\\."
32
33     - comment:
34         start: "//"
35         end: "$"
36         rules:
37             - todo: "(TODO|XXX|FIXME):?"
38
39     - comment:
40         start: "///"
41         end: "$"
42         rules:
43             - todo: "(TODO|XXX|FIXME):?"
44
45     - comment:
46         start: "/\\*\\*"
47         end: "\\*/"
48         rules:
49             - todo: "(TODO|XXX|FIXME):?"
50