Skip to content

Commit 434083b

Browse files
authored
Merge pull request #31 from rescript-lang/fix-exotic-polyvars
Fix highlighting of polymorphic variants
2 parents 297dc7b + f6373f9 commit 434083b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

syntax/rescript.vim

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ syntax match resFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)
7272

7373
" Module / Constructor
7474
syntax match resModuleOrVariant "\v<[A-Z][A-Za-z0-9_'$]*"
75-
syntax match resPolyVariant "\v#[A-za-z][A-Za-z0-9_'$]*"
7675
syntax match resModuleChain "\v<[A-Z][A-Za-z0-9_'$]*\."
7776

7877
" Attribute
@@ -87,6 +86,10 @@ syntax match resInterpolationVariable "\v\$[a-z_][A-Za-z0-0_'$]*" contained
8786
syntax region resString start="\v`" end="\v`" contains=resInterpolationVariable
8887
syntax region resString start="\v[a-z]`" end="\v`" contains=resInterpolationVariable
8988

89+
" Polymorphic variants
90+
syntax match resPolyVariant "\v#[A-za-z][A-Za-z0-9_'$]*"
91+
syntax match resPolyVariant "\v#\".*\""
92+
syntax match resPolyVariant "\v#\\\".*\""
9093

9194
highlight default link resBoolean Boolean
9295
highlight default link resKeyword Keyword

0 commit comments

Comments
 (0)