annotate nanorc.d/swift.nanorc @ 84:b989099cde9f

Start to update Nano colourisation Defaults are REALLY basic
author IBBoard <dev@ibboard.co.uk>
date Sat, 31 Mar 2018 21:06:21 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
84
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 ##############################################################################
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 # Swift syntax highlighting for Nano. v.1.1
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 ##############################################################################
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 syntax "Swift" "\.swift$"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 # Default
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 color white ".+"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 # Operators
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 color yellow "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 color brightyellow "[!]"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 # Statements
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 color magenta "\<(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|static|private|public|throws)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 color magenta "\<(lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 color magenta "\<(protocol|typealias|prefix|postfix|operator|extension|internal|external|unowned)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 # Keywords
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 color cyan "\<(print)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 color magenta "\<(init)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 # Attribute
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 color red "(@+[a-zA-Z]+)"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 # Numbers / Decimal Literal
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 color blue "\<([0-9]+)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 # Unicode Literal "U+"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 color blue "\<(U\++[0-9A-Z]+)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 # Binary Literal "0b"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 color blue "\<(0b+[0-1]+)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 # Octal Literal "0o"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 color blue "\<(0o+[0-7]+)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 # Hexadecimal Literal "0x"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 color blue "\<(0x+[0-9A-Fa-f]+)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 # Standard Types
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 color brightmagenta "\<((U)?Int(8|16|32|64))\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 color brightmagenta "\<(true|false|nil)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 color brightmagenta "\<(UInt|Int|Double|String|Float|Bool|Dictionary|Array|Character|Range|Set|Bit|RawByte|Slice)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 color brightmagenta "\<(UnicodeScalar|UnsafePointer|UnsafeMutablePointer)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 color magenta "\<(AnyObject)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 # Standard Type Aliases and Protocols
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 color magenta "\<(AnyObject|AnyClass|GeneratorType|AnyGenerator|Element|Optional|Mirror)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 color magenta "\<(UnicodeScalarType|IntMax|UIntMax|Void|Any|Comparable|Equatable|Hashable|SequenceType)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 # Standard Libraries
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 color cyan "\<(Foundation|Glibc|Darwin|XCTest)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 # Text
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 color red ""[^"]*""
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54 # Variable in Text
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 color white start="\\\(" end="\)"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 # Comments
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 color green "//.*"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 color brightgreen "///.*"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 color green start="/\*\*" end="\*/"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 color green "[/**]"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 # Trailing whitespace
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 color ,green "[[:space:]]+$"