From 5536991f40078cfadd77c6fcda9011bb76f9599b Mon Sep 17 00:00:00 2001 From: Philipp Leo Dylong Date: Fri, 29 Apr 2016 21:21:21 +0200 Subject: [PATCH] - added Standard Libraries - fixed and improved some Standard Types - made ! more visible --- swift.nanorc | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/swift.nanorc b/swift.nanorc index 5b64222..999b09a 100644 --- a/swift.nanorc +++ b/swift.nanorc @@ -1,5 +1,5 @@ ############################################################################## -# Swift syntax highlighting for Nano. +# Swift syntax highlighting for Nano. v.1.04 ############################################################################## syntax "Swift" "\.swift$" @@ -9,27 +9,37 @@ 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)\ " +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 "(print)" -color magenta "(init)" +color cyan "\b(print)\b" +color magenta "\b(init)\b" # Numbers -color blue "([0-9]+)" +color blue "\b([0-9]+)\b" # Standard Types -color brightmagenta "\ ((U)?Int(8|16|32|64))" -color brightmagenta "(true|false|nil)" -color brightmagenta "\ (Double|String|Float|Boolean|Dictionary|Array|Int)" -color magenta "\ (AnyObject)" +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 "///.*"