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:
Akshay Hegde
2017-08-23 21:51:02 -07:00
parent 8a0dacb4ab
commit 350d49c5b9
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -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\+\)\?"