1
0
mirror of https://github.com/scopatz/nanorc synced 2024-09-18 12:35:59 +02:00
nanorc/swift.nanorc
Philipp beb092d898 fixed some regex not working on osx.
Regex Word boundary "\b" not working on OSX, relaced with Start "\<" and End of Word "\>".
2016-05-03 13:06:39 +02:00

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 "\<(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\>"
color magenta "\<(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\>"
# Keywords
color cyan "\<(print)\>"
color magenta "\<(init)\>"
# Numbers
color blue "\<([0-9]+)\>"
# Standard Types
color brightmagenta "\<((U)?Int(8|16|32|64))\>"
color brightmagenta "\<(true|false|nil)\>"
color brightmagenta "\<(Double|String|Float|Bool|Dictionary|Array|Int|UInt|Character|Range|Set|UnicodeScalar|Bit|RawByte|Slice|UnsafePointer|UnsafeMutablePointer)\>"
color magenta "\<(AnyObject)\>"
# Standard Type Aliases and Protocols
color magenta "\<(AnyObject|AnyClass|GeneratorType|AnyGenerator|Element|Optional|Mirror|UnicodeScalarType|IntMax|UIntMax|Void|Any|Comparable|Equatable|Hashable|SequenceType)\>"
# Standard Libraries
color cyan "\<(Foundation|Glibc|Darwin|XCTest)\>"
# 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:]]+$"