mirror of
https://github.com/keith/swift.vim.git
synced 2025-12-17 12:00:25 +01:00
Fix an issue where numbers were being highlighted as properties
Improves regex for swiftMethod and swiftProperties to expect a non-digit following a period, as swift does not allow methods/funcs starting with a digit. Resolves #100
This commit is contained in:
@@ -49,6 +49,7 @@ if foo {
|
|||||||
5 // int
|
5 // int
|
||||||
|
|
||||||
5.5 // float
|
5.5 // float
|
||||||
|
45.4
|
||||||
5e-2
|
5e-2
|
||||||
5E2
|
5E2
|
||||||
5.5E-2
|
5.5E-2
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ syntax match swiftOperator "\v\>"
|
|||||||
syntax match swiftOperator "\v\?\?"
|
syntax match swiftOperator "\v\?\?"
|
||||||
|
|
||||||
" Methods/Functions/Properties
|
" Methods/Functions/Properties
|
||||||
syntax match swiftMethod "\(\.\)\@<=\w\+\((\)\@="
|
syntax match swiftMethod "\.\@<=\<\D\w*\>\ze("
|
||||||
syntax match swiftProperty "\(\.\)\@<=\<\w\+\>(\@!"
|
syntax match swiftProperty "\.\@<=\<\D\w*\>(\@!"
|
||||||
|
|
||||||
" Swift closure arguments
|
" Swift closure arguments
|
||||||
syntax match swiftClosureArgument "\$\d\+\(\.\d\+\)\?"
|
syntax match swiftClosureArgument "\$\d\+\(\.\d\+\)\?"
|
||||||
|
|||||||
Reference in New Issue
Block a user