Skip to content

Commit

Permalink
vim: remove duplicate swiftFuncName
Browse files Browse the repository at this point in the history
This was duplicating the swiftTypeName.  However, the swiftTypeName is more
generically named and applies to both types and functions both in structure and
usage.  Retain the single definition.
  • Loading branch information
compnerd committed Jun 4, 2016
1 parent 9a326fa commit 91ec0e3
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions utils/vim/syntax/swift.vim
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ syn keyword swiftScope

syn keyword swiftMutating skipwhite nextgroup=swiftFuncDefinition
\ mutating
syn keyword swiftFuncDefinition skipwhite nextgroup=swiftFuncName,swiftOperator
syn keyword swiftFuncDefinition skipwhite nextgroup=swiftTypeName,swiftOperator
\ func

syn keyword swiftTypeDefinition skipwhite nextgroup=swiftTypeName
Expand All @@ -94,6 +94,10 @@ syn keyword swiftVarDefinition skipwhite nextgroup=swiftVarName

syn match swiftTypeName contained nextgroup=swiftTypeParameters
\ /\<[A-Za-z_][A-Za-z_0-9\.]*\>/
syn match swiftVarName contained skipwhite nextgroup=swiftTypeDeclaration
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/
syn match swiftImplicitVarName
\ /\$\<[A-Za-z_0-9]\+\>/

" TypeName[Optionality]?
syn match swiftType contained nextgroup=swiftTypeParameters
Expand All @@ -116,16 +120,10 @@ syn match swiftArchetype contained skipwhite nextgroup=swiftTypeDeclaration
syn keyword swiftConstraint contained
\ where

syn match swiftFuncName contained skipwhite nextgroup=swiftTypeParameters
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/

syn match swiftVarName contained
\ /\<[A-Za-z_][A-Za-z_0-9]*\>/
syn match swiftImplicitVarName
\ /\$\<[A-Za-z_0-9]\+\>/

syn match swiftTypeDeclaration /:/ skipwhite nextgroup=swiftType
syn match swiftTypeDeclaration /->/ skipwhite nextgroup=swiftType
syn match swiftTypeDeclaration skipwhite nextgroup=swiftType
\ /:/
syn match swiftTypeDeclaration skipwhite nextgroup=swiftType
\ /->/

syn keyword swiftBoolean true false

Expand Down Expand Up @@ -173,7 +171,6 @@ hi def link swiftArchetype Identifier
hi def link swiftConstraint Special
hi def link swiftFuncDefinition Define
hi def link swiftDefinitionModifier Define
hi def link swiftFuncName Function
hi def link swiftFuncKeyword Function
hi def link swiftFuncKeywordGeneral Function
hi def link swiftVarDefinition Define
Expand Down

0 comments on commit 91ec0e3

Please sign in to comment.