Skip to content

Commit 8714fab

Browse files
committed
Beef up interpolation
1 parent db3055f commit 8714fab

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

ReScript.sublime-syntax

+1-9
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,7 @@ contexts:
9999
# TODO: will need expression
100100
- include: operator
101101
- include: punctuations
102-
- match: (\$)
103-
captures:
104-
1: punctuation.section.interpolation
105-
push:
106-
- clear_scopes: 1
107-
- match: '{{RE_IDENT}}'
108-
pop: true
109-
- match: '(?=\S)'
110-
pop: true
102+
- include: string
111103
- match: '`'
112104
scope: punctuation.definition.string.end
113105
pop: true

syntax_test.res

+13-4
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ let str = `hi`
4646
// ^ string.quoted.other punctuation.definition.string.end
4747
let interp = j`hello $bla bye`
4848
// ^ string.quoted.other variable.annotation
49-
// ^ punctuation.section.interpolation
50-
// ^^^ source.res
49+
// ^^^^ source.res
5150
// ^^^^^ string.quoted.other
5251
let interp = j`hello $1 bye`
53-
// ^^^^^^ string.quoted.other
52+
// ^^^^^^^ string.quoted.other
5453
let interp = j`hi ${world.bla->b(a)} bye`
5554
// ^ string.quoted.other punctuation.definition.string.begin
5655
// ^^^ string.quoted.other
@@ -61,7 +60,17 @@ let interp = j`hi ${world.bla->b(a)} bye`
6160
// ^ punctuation.section.interpolation.end
6261
// ^^^ string.quoted.other
6362
// ^ string.quoted.other punctuation.definition.string.end
64-
63+
let asd = `a${hello(`world ${hi} bye`)}b$`
64+
// ^^^^^^ source.res
65+
// ^ string.quoted.other punctuation.definition.string.begin
66+
// ^^^^^^ string.quoted.other
67+
// ^^ punctuation.section.interpolation.begin
68+
// ^^ source.res
69+
// ^ punctuation.section.interpolation.end
70+
// ^^^^^ string.quoted.other
71+
// ^ punctuation.section.interpolation.end
72+
// ^^ string.quoted.other
73+
// ^ string.quoted.other punctuation.definition.string.end
6574

6675
// === numbers
6776

0 commit comments

Comments
 (0)