2016-03-21 16:16:02 +00:00
|
|
|
##############################################################################
|
|
|
|
|
# Swift syntax highlighting for Nano.
|
|
|
|
|
##############################################################################
|
|
|
|
|
|
2016-08-25 00:15:36 +00:00
|
|
|
syntax "swift" "\.swift$"
|
2016-03-21 16:16:02 +00:00
|
|
|
|
|
|
|
|
# Operators
|
2016-03-21 20:02:58 +00:00
|
|
|
color statement "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
|
2016-03-21 16:16:02 +00:00
|
|
|
|
|
|
|
|
# Statements
|
2016-03-21 20:02:58 +00:00
|
|
|
color statement "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\ "
|
|
|
|
|
color statement "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\ "
|
2016-03-21 16:16:02 +00:00
|
|
|
|
|
|
|
|
# Keywords
|
2016-03-21 20:02:58 +00:00
|
|
|
color statement "(print)"
|
|
|
|
|
color statement "(init)"
|
2016-03-21 16:16:02 +00:00
|
|
|
|
|
|
|
|
# Numbers
|
2016-08-27 21:10:26 +00:00
|
|
|
color constant.number "([0-9]+)"
|
2016-03-21 16:16:02 +00:00
|
|
|
|
|
|
|
|
# Standard Types
|
2016-03-21 20:02:58 +00:00
|
|
|
color type "\ ((U)?Int(8|16|32|64))"
|
|
|
|
|
color constant "(true|false|nil)"
|
|
|
|
|
color type "\ (Double|String|Float|Boolean|Dictionary|Array|Int)"
|
|
|
|
|
color type "\ (AnyObject)"
|
2016-03-21 16:16:02 +00:00
|
|
|
|
|
|
|
|
# Text
|
2016-06-25 23:20:13 +00:00
|
|
|
color constant.string ""[^"]*""
|
2016-03-21 16:16:02 +00:00
|
|
|
|
|
|
|
|
# Comments
|
2016-03-21 20:02:58 +00:00
|
|
|
color comment "//.*"
|
|
|
|
|
color comment "///.*"
|
2016-03-25 20:41:36 +00:00
|
|
|
color comment start="/\*\*" end="\*/"
|
2016-03-21 20:02:58 +00:00
|
|
|
color comment "[/**]"
|