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"
2
2
3
3
let var = ` hello ${name} how you doin?`
4
4
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
+
5
11
let 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
82
82
syntax match resEscapedChar " \v\\ [\\ "'ntbrf]" contained
83
83
syntax region resString start =" \v\" " end =" \v\" " contains =resEscapedQuote,resEscapedChar,resUnicodeChar
84
84
85
+ " Interpolation
86
+ syntax match resInterpolationVariable " \v\$ [a-z_][A-Za-z0-0_'$]*" contained
85
87
syntax region resInterpolationBlock matchgroup =resInterpolationDelimiters start =" \v\$\{ " end =" \v\} " contained contains =TOP
86
88
syntax 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
88
90
89
91
" Polymorphic variants
90
92
syntax match resPolyVariant " \v #[A-za-z][A-Za-z0-9_'$]*"
@@ -110,6 +112,7 @@ highlight default link resUnicodeChar Character
110
112
highlight default link resEscapedChar Character
111
113
highlight default link resString String
112
114
highlight default link resInterpolationDelimiters Macro
115
+ highlight default link resInterpolationVariable Macro
113
116
highlight default link resAttribute PreProc
114
117
115
118
let b: current_syntax = " rescript"
You can’t perform that action at this time.
0 commit comments