|
|
@ -43,7 +43,17 @@ const generateLanguageDefinition = (identifiers: string[]) => { |
|
|
|
[/"/, { token: 'string.quote', bracket: '@open', next: '@dblString' }], |
|
|
|
[/"/, { token: 'string.quote', bracket: '@open', next: '@dblString' }], |
|
|
|
[/'/, { token: 'string.quote', bracket: '@open', next: '@sglString' }], |
|
|
|
[/'/, { token: 'string.quote', bracket: '@open', next: '@sglString' }], |
|
|
|
[ |
|
|
|
[ |
|
|
|
new RegExp(`\\{(${identifiers.join('|').replace(/[{}]/g, '')})\\}`), |
|
|
|
new RegExp( |
|
|
|
|
|
|
|
`\\{(${identifiers |
|
|
|
|
|
|
|
.map((identifier) => |
|
|
|
|
|
|
|
identifier |
|
|
|
|
|
|
|
// remove curly braces wrapping the identifier
|
|
|
|
|
|
|
|
.replace(/^\{([\s\S]+)\}$/, '$1') |
|
|
|
|
|
|
|
// escape special characters
|
|
|
|
|
|
|
|
.replace(/[.*+?^${}()|[\]\\-]/g, '\\$&'), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.join('|')})\\}`,
|
|
|
|
|
|
|
|
), |
|
|
|
{ |
|
|
|
{ |
|
|
|
cases: { |
|
|
|
cases: { |
|
|
|
'@identifiers': 'identifier', |
|
|
|
'@identifiers': 'identifier', |
|
|
|