]> git.lizzy.rs Git - micro.git/blob - syntax_files/swift.micro
Add syntax flags and fix a couple highlighting bugs
[micro.git] / syntax_files / swift.micro
1 ##############################################################################
2 # Swift syntax highlighting for Nano.
3 ##############################################################################
4
5 syntax "Swift" "\.swift$"
6
7 # Default
8 color white ".+"
9
10 # Operators
11 color yellow "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
12
13 # Statements
14 color magenta  "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\ "
15 color magenta  "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\ "
16
17 # Keywords
18 color cyan "(print)"
19 color magenta "(init)"
20
21 # Numbers
22 color blue "([0-9]+)"
23
24 # Standard Types
25 color brightmagenta "\ ((U)?Int(8|16|32|64))"
26 color brightmagenta "(true|false|nil)"
27 color brightmagenta "\ (Double|String|Float|Boolean|Dictionary|Array|Int)"
28 color magenta "\ (AnyObject)"
29
30 # Text
31 color red ""[^"]*""
32
33 # Comments
34 color green "//.*"
35 color brightgreen "///.*"
36 color green (s) "/\*\*.*?\*/"
37 color green "[/**]"
38
39 # Trailing whitespace
40 color ,green "[[:space:]]+$"