File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
examples/rescript-project/src Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,10 @@ let name = "Amirali"
22
33let var = ` hello ${name} how you doin?`
44
5+ let var2 = j ` hello ${name} how you doin?`
6+
7+ let var3 = j ` hello $name how you doin?`
8+
9+ let varInvalid = ` hello $name how you doin?`
10+
511let expr = ` 2 + 2 is ${Int.toString(2 + 2)}`
Original file line number Diff line number Diff line change @@ -82,9 +82,11 @@ syntax match resUnicodeChar "\v\\u[A-Fa-f0-9]\{4}" contained
8282syntax match resEscapedChar " \v\\ [\\ "'ntbrf]" contained
8383syntax region resString start =" \v\" " end =" \v\" " contains =resEscapedQuote,resEscapedChar,resUnicodeChar
8484
85+ " Interpolation
86+ syntax match resInterpolationVariable " \v\$ [a-z_][A-Za-z0-0_'$]*" contained
8587syntax region resInterpolationBlock matchgroup =resInterpolationDelimiters start =" \v\$\{ " end =" \v\} " contained contains =TOP
8688syntax region resString start =" \v `" end =" \v `" contains =resInterpolationBlock
87- syntax region resString start =" \v [a-z]`" end =" \v `" contains =resInterpolationBlock
89+ syntax region resString start =" \v [a-z]`" end =" \v `" contains =resInterpolationBlock,resInterpolationVariable
8890
8991" Polymorphic variants
9092syntax match resPolyVariant " \v #[A-za-z][A-Za-z0-9_'$]*"
@@ -110,6 +112,7 @@ highlight default link resUnicodeChar Character
110112highlight default link resEscapedChar Character
111113highlight default link resString String
112114highlight default link resInterpolationDelimiters Macro
115+ highlight default link resInterpolationVariable Macro
113116highlight default link resAttribute PreProc
114117
115118let b: current_syntax = " rescript"
You can’t perform that action at this time.
0 commit comments