mirror of
https://github.com/scopatz/nanorc
synced 2024-10-05 07:24:51 +02:00
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
##############################################################################
|
|
# Swift syntax highlighting for Nano. v.1.04
|
|
##############################################################################
|
|
|
|
syntax "Swift" "\.swift$"
|
|
|
|
# Default
|
|
color white ".+"
|
|
|
|
# Operators
|
|
color yellow "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
|
|
color brightyellow "[!]"
|
|
|
|
# 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"
|
|
|
|
# Keywords
|
|
color cyan "\b(print)\b"
|
|
color magenta "\b(init)\b"
|
|
|
|
# Numbers
|
|
color blue "\b([0-9]+)\b"
|
|
|
|
# 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
|
|
color cyan "\b(Foundation|Glibc|Darwin|XCTest)\b"
|
|
|
|
# Text
|
|
color red ""[^"]*""
|
|
|
|
# Variable in Text
|
|
color white start="\\\(" end="\)"
|
|
|
|
# Comments
|
|
color green "//.*"
|
|
color brightgreen "///.*"
|
|
color green start="/\*\*" end="\*/"
|
|
color green "[/**]"
|
|
|
|
# Trailing whitespace
|
|
color ,green "[[:space:]]+$"
|