nanorc/swift.nanorc

51 lines
1.6 KiB
Plaintext
Raw Normal View History

2016-03-07 22:32:57 +01:00
##############################################################################
# Swift syntax highlighting for Nano. v.1.04
2016-03-07 22:32:57 +01:00
##############################################################################
syntax "Swift" "\.swift$"
# Default
color white ".+"
# Operators
color yellow "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
color brightyellow "[!]"
2016-03-07 22:32:57 +01:00
# Statements
color magenta "\b(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\b"
color magenta "\b(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\b"
2016-03-07 22:32:57 +01:00
# Keywords
color cyan "\b(print)\b"
color magenta "\b(init)\b"
2016-03-07 22:32:57 +01:00
# Numbers
color blue "\b([0-9]+)\b"
2016-03-07 22:32:57 +01:00
# Standard Types
color brightmagenta "\b((U)?Int(8|16|32|64))\b"
color brightmagenta "\b(true|false|nil)\b"
color brightmagenta "\b(Double|String|Float|Bool|Dictionary|Array|Int|UInt|Character|Range|Set|UnicodeScalar|Bit|RawByte|Slice|UnsafePointer|UnsafeMutablePointer)\b"
color magenta "\b(AnyObject)\b"
# Standard Type Aliases and Protocols
color magenta "\b(AnyObject|AnyClass|GeneratorType|AnyGenerator|Element|Optional|Mirror|UnicodeScalarType|IntMax|UIntMax|Void|Any|Comparable|Equatable|Hashable|SequenceType)\b"
# Standard Libraries
2016-04-29 21:32:22 +02:00
color cyan "\b(Foundation|Glibc|Darwin|XCTest)\b"
2016-03-07 22:32:57 +01:00
# Text
color red ""[^"]*""
# Variable in Text
color white start="\\\(" end="\)"
2016-03-07 22:32:57 +01:00
# Comments
color green "//.*"
color brightgreen "///.*"
color green start="/\*\*" end="\*/"
color green "[/**]"
# Trailing whitespace
color ,green "[[:space:]]+$"