mirror of
https://github.com/scopatz/nanorc
synced 2024-11-27 12:25:53 +01:00
commit
ee8658930a
46
swift.nanorc
46
swift.nanorc
|
@ -1,5 +1,5 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Swift syntax highlighting for Nano.
|
# Swift syntax highlighting for Nano. v.1.1
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
syntax "Swift" "\.swift$"
|
syntax "Swift" "\.swift$"
|
||||||
|
@ -9,27 +9,51 @@ color white ".+"
|
||||||
|
|
||||||
# Operators
|
# Operators
|
||||||
color yellow "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
|
color yellow "[.:;,+*|=!?\%]" "<" ">" "/" "-" "&"
|
||||||
|
color brightyellow "[!]"
|
||||||
|
|
||||||
# Statements
|
# 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 "\<(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|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 "\<(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
|
# Keywords
|
||||||
color cyan "(print)"
|
color cyan "\<(print)\>"
|
||||||
color magenta "(init)"
|
color magenta "\<(init)\>"
|
||||||
|
|
||||||
# Numbers
|
# Attribute
|
||||||
color blue "([0-9]+)"
|
color red "(@+[a-zA-Z]+)"
|
||||||
|
|
||||||
|
# Numbers / Decimal Literal
|
||||||
|
color blue "\<([0-9]+)\>"
|
||||||
|
# Unicode Literal "U+"
|
||||||
|
color blue "\<(U\++[0-9A-Z]+)\>"
|
||||||
|
# Binary Literal "0b"
|
||||||
|
color blue "\<(0b+[0-1]+)\>"
|
||||||
|
# Octal Literal "0o"
|
||||||
|
color blue "\<(0o+[0-7]+)\>"
|
||||||
|
# Hexadecimal Literal "0x"
|
||||||
|
color blue "\<(0x+[0-9A-Fa-f]+)\>"
|
||||||
|
|
||||||
# Standard Types
|
# Standard Types
|
||||||
color brightmagenta "\ ((U)?Int(8|16|32|64))"
|
color brightmagenta "\<((U)?Int(8|16|32|64))\>"
|
||||||
color brightmagenta "(true|false|nil)"
|
color brightmagenta "\<(true|false|nil)\>"
|
||||||
color brightmagenta "\ (Double|String|Float|Boolean|Dictionary|Array|Int)"
|
color brightmagenta "\<(UInt|Int|Double|String|Float|Bool|Dictionary|Array|Character|Range|Set|Bit|RawByte|Slice)\>"
|
||||||
color magenta "\ (AnyObject)"
|
color brightmagenta "\<(UnicodeScalar|UnsafePointer|UnsafeMutablePointer)\>"
|
||||||
|
color magenta "\<(AnyObject)\>"
|
||||||
|
|
||||||
|
# Standard Type Aliases and Protocols
|
||||||
|
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)\>"
|
||||||
|
|
||||||
# Text
|
# Text
|
||||||
color red ""[^"]*""
|
color red ""[^"]*""
|
||||||
|
|
||||||
|
# Variable in Text
|
||||||
|
color white start="\\\(" end="\)"
|
||||||
|
|
||||||
# Comments
|
# Comments
|
||||||
color green "//.*"
|
color green "//.*"
|
||||||
color brightgreen "///.*"
|
color brightgreen "///.*"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user