micro/runtime/syntax/swift.micro

35 lines
1 KiB
Text
Raw Normal View History

2016-03-21 19:16:02 +03:00
##############################################################################
# Swift syntax highlighting for Nano.
##############################################################################
syntax "Swift" "\.swift$"
# Operators
color statement "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
2016-03-21 19:16:02 +03:00
# Statements
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 19:16:02 +03:00
# Keywords
color statement "(print)"
color statement "(init)"
2016-03-21 19:16:02 +03:00
# Numbers
color constant "([0-9]+)"
2016-03-21 19:16:02 +03:00
# Standard Types
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 19:16:02 +03:00
# Text
color constant ""[^"]*""
2016-03-21 19:16:02 +03:00
# Comments
color comment "//.*"
color comment "///.*"
2016-03-25 23:41:36 +03:00
color comment start="/\*\*" end="\*/"
color comment "[/**]"