Browse Source

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

tags/v1.1.0
cn 3 years ago
parent
commit
8396584552
2 changed files with 42 additions and 0 deletions
  1. +2
    -0
      CHANGELOG.md
  2. +40
    -0
      grammars/fluentd.cson

+ 2
- 0
CHANGELOG.md 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:


+ 40
- 0
grammars/fluentd.cson View File

@ -110,6 +110,46 @@ repository:
]
}
{
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'
captures:


Loading…
Cancel
Save