added Attributes case

-added Attributes case highlight words beginning with a @ sing
-made some lines more compact for readability
This commit is contained in:
Philipp Leo Dylong 2016-05-05 11:21:18 +02:00
parent 8afb5e604d
commit f8f7242417

View File

@ -1,5 +1,5 @@
##############################################################################
# Swift syntax highlighting for Nano. v.1.04
# Swift syntax highlighting for Nano. v.1.1
##############################################################################
syntax "Swift" "\.swift$"
@ -12,24 +12,30 @@ color yellow "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
color brightyellow "[!]"
# Statements
color magenta "\<(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|static|private|public|throws)\>"
color magenta "\<(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\>"
color magenta "\<(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|static|private|public|throws)\>"
color magenta "\<(lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\>"
color magenta "\<(protocol|typealias|prefix|postfix|operator|extension|internal|external|unowned)\>"
# Keywords
color cyan "\<(print)\>"
color magenta "\<(init)\>"
# Attribute
color red "(@+[a-zA-Z]+)"
# 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 brightmagenta "\<(UInt|Int|Double|String|Float|Bool|Dictionary|Array|Character|Range|Set|Bit|RawByte|Slice)\>"
color brightmagenta "\<(UnicodeScalar|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)\>"
color magenta "\<(AnyObject|AnyClass|GeneratorType|AnyGenerator|Element|Optional|Mirror)\>"
color magenta "\<(UnicodeScalarType|IntMax|UIntMax|Void|Any|Comparable|Equatable|Hashable|SequenceType)\>"
# Standard Libraries
color cyan "\<(Foundation|Glibc|Darwin|XCTest)\>"