Skip to content

Commit a4fb9a0

Browse files
committed
generalize string interpolation to processed strings, i.e. <id>"..."
1 parent e007203 commit a4fb9a0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/typescript/Scala.tmLanguage.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { TmLanguage } from "./TMLanguageModel";
44
const letter = "[_a-zA-Z\\$\\p{Lo}\\p{Lt}\\p{Nl}\\p{Ll}\\p{Lu}]"
55
const digit = "[0-9]"
66
const letterOrDigit = `${letter}|${digit}`
7+
const opchar = `[!#%&*+\\-\\/:<>=?@\\\\^|~[\\p{Sm}\\p{So}]]`
8+
const op = `${opchar}+`
9+
const idrest = `${letter}(?:${letterOrDigit})*(?:_${op})?`
10+
const alphaId = `${letter}+`
711
const simpleInterpolatedVariable = `${letter}(?:${letterOrDigit})*` // see SIP-11 https://docs.scala-lang.org/sips/string-interpolation.html
812

913
export const scalaTmLanguage: TmLanguage = {
@@ -223,7 +227,7 @@ export const scalaTmLanguage: TmLanguage = {
223227
name: 'string.quoted.triple.scala'
224228
},
225229
{
226-
begin: '\\b(s|f|raw)(""")',
230+
begin: `\\b(${alphaId})(""")`,
227231
end: '"""(?!")',
228232
beginCaptures: {
229233
'1': {
@@ -278,7 +282,7 @@ export const scalaTmLanguage: TmLanguage = {
278282
name: 'string.quoted.double.scala'
279283
},
280284
{
281-
begin: '\\b(s|f|raw)(")',
285+
begin: `\\b(${alphaId})(")`,
282286
end: '"',
283287
beginCaptures: {
284288
'1': {

0 commit comments

Comments
 (0)