grammar: support some flavors of value types like array/hash (using JSON source), integer etc

This commit is contained in:
cn 2017-11-24 23:19:21 +01:00
parent ee37db2d42
commit 8396584552
2 changed files with 42 additions and 0 deletions

View File

@ -7,6 +7,8 @@ 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
- Support array and hash (using JSON source) value types like `["foo","bar"]`
- Support integer, time and size value types (e.g. `property 100`, `bufsize 5M` or `finterval 5s`)
IMPROVEMENTS:

View File

@ -109,6 +109,46 @@ repository:
{include: '#stringescapes'}
]
}
{
begin: '(\\[)'
beginCaptures:
'1':
name: 'punctuation.definition.array.begin.fluentd'
end: '(\\])'
endCaptures:
'1':
name: 'punctuation.definition.array.end.fluentd'
name: 'meta.value.array.fluentd'
patterns: [
{include: 'source.json'}
]
}
{
begin: '\\{'
beginCaptures:
'1':
name: 'punctuation.definition.hash.begin.fluentd'
end: '\\}'
endCaptures:
'1':
name: 'punctuation.definition.hash.end.fluentd'
name: 'meta.value.hash.fluentd'
patterns: [
{include: 'source.json'}
]
}
{
match: '\\b(\\d+)\\b'
name: 'value.constant.integer.fluentd'
}
{
match: '\\b(\\d+[kmgtKMGT])\\b'
name: 'value.constant.size.fluentd'
}
{
match: '\\b(\\d+[smhd])\\b'
name: 'value.constant.time.fluentd'
}
{
match: '([^\\s]+?)'
name: 'meta.string.unquoted.fluentd'