grammar: add support for escape sequenes in single, double and unquoted strings

This commit is contained in:
cn 2017-11-24 23:18:04 +01:00
parent f2d50423de
commit ee37db2d42
2 changed files with 18 additions and 0 deletions

View File

@ -6,6 +6,7 @@ NEW FEATURES:
- Support folding markers for directives like `<source>...</source>`
- Support toggling comments
- Support escape sequenes like `foo\nbar` in single, double and unquoted strings
IMPROVEMENTS:

View File

@ -77,6 +77,10 @@ repository:
]
values:
patterns: [
{
match: '\\\\.'
name: 'value.string.escape.fluentd'
}
{
begin: '(")'
beginCaptures:
@ -87,6 +91,9 @@ repository:
'1':
name: 'punctuation.definition.string.end.fluentd'
name: 'meta.value.string.quoted.double.fluentd'
patterns: [
{include: '#stringescapes'}
]
}
{
begin: "(')"
@ -98,6 +105,9 @@ repository:
'1':
name: 'punctuation.definition.string.end.fluentd'
name: 'meta.value.string.quoted.single.fluentd'
patterns: [
{include: '#stringescapes'}
]
}
{
match: '([^\\s]+?)'
@ -107,3 +117,10 @@ repository:
name: 'string.unquoted.fluentd'
}
]
stringescapes:
patterns: [
{
match: '\\\\.'
name: 'constant.string.escape.fluentd'
}
]