Skip to content

Fix highlighting of polymorphic variants #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion syntax/rescript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ syntax match resFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)

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

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

" Polymorphic variants
syntax match resPolyVariant "\v#[A-za-z][A-Za-z0-9_'$]*"
syntax match resPolyVariant "\v#\".*\""
syntax match resPolyVariant "\v#\\\".*\""

highlight default link resBoolean Boolean
highlight default link resKeyword Keyword
Expand Down