@@ -42,36 +42,56 @@ syn keyword swiftKeyword
42
42
\ return
43
43
\ static
44
44
\ switch
45
+ \ throw
45
46
\ try
46
47
\ typealias
47
48
\ var
48
49
\ where
49
50
\ while
50
51
52
+ syn keyword swiftDefinitionModifier
53
+ \ dynamic
54
+ \ internal
55
+ \ private
56
+ \ public
57
+ \ static
58
+ \ throws
59
+
60
+ syn keyword swiftIdentifierKeyword
61
+ \ Self
62
+ \ dynamicType
63
+ \ metatype
64
+ \ self
65
+ \ super
66
+
67
+ syn keyword swiftFuncKeyword nextgroup =swiftTypeParameters
68
+ \ deinit
69
+ \ init
70
+ \ subscript
71
+
72
+ syn keyword swiftScope
73
+ \ autoreleasepool
74
+
51
75
syn keyword swiftTypeDefinition class extension protocol struct typealias enum skipwhite nextgroup =swiftTypeName
52
- syn region swiftTypeAttributes start =" \[ " end =" \] " contained skipwhite nextgroup =swiftTypeName
53
- syn match swiftTypeName / \< [A-Za-z_][A-Za-z_0-9\. ]*\> / contained nextgroup =swiftTypeParameters
76
+
77
+ syn match swiftTypeName / \< [A-Za-z_][A-Za-z_0-9\. ]*\> [!?]\? / contained nextgroup =swiftTypeParameters
78
+ syn region swiftArrayType start =/ \[ / end =/ \] / contained skipwhite nextgroup =swiftTypeName
54
79
55
80
syn region swiftTypeParameters start =" <" end =" >" contained
56
81
57
82
syn keyword swiftMutating mutating skipwhite nextgroup =swiftFuncDefinition
58
- syn keyword swiftFuncDefinition func skipwhite nextgroup =swiftFuncAttributes,swiftFuncName,swiftOperator
59
- syn region swiftFuncAttributes start =" \[ " end =" \] " contained skipwhite nextgroup =swiftFuncName,swiftOperator
83
+ syn keyword swiftFuncDefinition func skipwhite nextgroup =swiftFuncName,swiftOperator
60
84
syn match swiftFuncName / \< [A-Za-z_][A-Za-z_0-9]*\> / contained skipwhite nextgroup =swiftTypeParameters
61
- syn keyword swiftFuncKeyword subscript init destructor nextgroup =swiftTypeParameters
62
85
63
86
syn keyword swiftVarDefinition var skipwhite nextgroup =swiftVarName
64
87
syn keyword swiftVarDefinition let skipwhite nextgroup =swiftVarName
65
88
syn match swiftVarName / \< [A-Za-z_][A-Za-z_0-9]*\> / contained
66
89
67
- syn keyword swiftDefinitionModifier static public internal private
68
-
69
90
syn match swiftImplicitVarName / \$\< [A-Za-z_0-9]\+\> /
70
91
71
- syn match swiftTypeDeclaration / :/ skipwhite nextgroup =swiftTypeAttributes, swiftTypeName
72
- syn match swiftTypeDeclaration / ->/ skipwhite nextgroup =swiftTypeAttributes, swiftTypeName
92
+ syn match swiftTypeDeclaration / :/ skipwhite nextgroup =swiftTypeName
93
+ syn match swiftTypeDeclaration / ->/ skipwhite nextgroup =swiftTypeName
73
94
74
- syn keyword swiftIdentifierKeyword metatype super self Self
75
95
76
96
syn keyword swiftNew new skipwhite nextgroup =swiftTypeName
77
97
@@ -101,7 +121,9 @@ syn match swiftAttribute /@\<\w\+\>/
101
121
102
122
syn keyword swiftTodo TODO FIXME contained
103
123
syn keyword swiftNil nil
104
- syn match swiftNilOps " \< as?\?\> "
124
+
125
+ syn match swiftCastOp " \< as\> [!?]\? " skipwhite nextgroup =swiftTypeName,swiftArrayType
126
+
105
127
syn match swiftNilOps " ??"
106
128
107
129
hi def link swiftImport Include
@@ -110,12 +132,11 @@ hi def link swiftImportComponent Identifier
110
132
hi def link swiftKeyword Statement
111
133
hi def link swiftTypeDefinition Define
112
134
hi def link swiftTypeName Type
135
+ hi def link swiftArrayType Type
113
136
hi def link swiftTypeParameters Special
114
- hi def link swiftTypeAttributes PreProc
115
137
hi def link swiftFuncDefinition Define
116
138
hi def link swiftDefinitionModifier Define
117
139
hi def link swiftFuncName Function
118
- hi def link swiftFuncAttributes PreProc
119
140
hi def link swiftFuncKeyword Function
120
141
hi def link swiftVarDefinition Define
121
142
hi def link swiftVarName Identifier
@@ -141,6 +162,8 @@ hi def link swiftPreprocFalse Comment
141
162
hi def link swiftAttribute Type
142
163
hi def link swiftTodo Todo
143
164
hi def link swiftNil Constant
165
+ hi def link swiftCastOp Operator
144
166
hi def link swiftNilOps Operator
167
+ hi def link swiftScope PreProc
145
168
146
169
let b: current_syntax = " swift"
0 commit comments