Move comment pattern, update division operator

This fixes an issue where the beginning /* in a C-style block comment
was interpreted as an operator. I read somewhere in syntax.txt (I think)
that the order rules appear in the syntax definition file affects the
interpretation. This is one of those times. The comment block needs to
be after the operator definitions.
This commit is contained in:
Keith Smiley
2014-12-07 16:04:34 -08:00
parent be757db8a8
commit 2d00be335b

View File

@@ -15,13 +15,6 @@ syntax match swiftShebang "\v#!.*$"
syntax keyword swiftTodos contained TODO XXX FIXME NOTE
syntax keyword swiftMarker contained MARK
" Comment patterns
syntax match swiftComment "\v\/\/.*$"
\ contains=swiftTodos,swiftMarker,@Spell oneline
syntax region swiftComment start="\v^\s*\/\*" end="\v\*\/"
\ contains=swiftTodos,swiftMarker,swiftComment,@Spell fold
" Literals
" Strings
syntax region swiftString start=/"/ skip=/\\"/ end=/"/ contains=swiftInterpolatedWrapper
@@ -53,7 +46,7 @@ syntax match swiftOperator "\v-"
syntax match swiftOperator "\v\+"
syntax match swiftOperator "\v\="
syntax match swiftOperator "\v\|"
syntax match swiftOperator "\v[^/"]\/[^/"]"
syntax match swiftOperator "\v\/"
syntax match swiftOperator "\v\."
syntax match swiftOperator "\v\<"
syntax match swiftOperator "\v\>"
@@ -156,6 +149,13 @@ syntax keyword swiftPreprocessor
\ #endif
" Comment patterns
syntax match swiftComment "\v\/\/.*$"
\ contains=swiftTodos,swiftMarker,@Spell oneline
syntax region swiftComment start="/\*" end="\*/"
\ contains=swiftTodos,swiftMarker,swiftComment,@Spell fold
" Set highlights
highlight default link swiftTodos Todo
highlight default link swiftShebang Comment