1
0
Derivar 0
language-fluentd/grammars/fluentd.cson

187 linhas
4.4 KiB
Plaintext

scopeName: 'source.fluentd'
name: 'Fluentd Configuration'
fileTypes: [
'fluent.conf'
]
foldingStartMarker: '<[^>]+>\\s*$'
foldingStopMarker: '^\\s*</[^>]+>'
patterns: [
{include: '#comments'}
{include: '#directives'}
]
repository:
comments:
patterns: [
{
match: '#.*'
name: 'comment.line.number-sign.fluentd'
}
]
directives:
patterns: [
{
match: '((@)include)\\s+([^\\s]+)'
captures:
'1':
name: 'entity.directive.begin.fluentd'
'2':
name: 'punctuation.definition.directive.begin.fluentd'
'3':
name: 'entity.other.directive.attribute-name.fluentd'
}
{
begin: '((<)[^\\s]+(\\s+[^>]+)?(>))'
beginCaptures:
'1':
name: 'entity.directive.begin.fluentd'
'2':
name: 'punctuation.definition.directive.begin.fluentd'
'3':
name: 'entity.other.directive.attribute-name.fluentd'
'4':
name: 'punctuation.definition.directive.end.fluentd'
end: '((</)\\w+(>))'
endCaptures:
'1':
name: 'entity.directive.end.fluentd'
'2':
name: 'punctuation.definition.directive.begin.fluentd'
'3':
name: 'punctuation.definition.directive.end.fluentd'
name: 'meta.directive.fluentd'
patterns: [
{include: '#comments'}
{include: '#directives'}
{include: '#parameters'}
]
}
]
parameters:
patterns: [
{
begin: '(@[^\\s]+)|([^\\s]+)'
beginCaptures:
'1':
name: 'keyword.parameter.system.fluentd'
'2':
name: 'keyword.parameter.fluentd'
end: '\\n'
name: 'meta.parameter.fluentd'
patterns: [
{include: '#comments'}
{include: '#values'}
]
}
]
values:
patterns: [
{
match: '\\\\.'
name: 'value.string.escape.fluentd'
}
{
begin: '(")'
beginCaptures:
'1':
name: 'punctuation.definition.string.begin.fluentd'
end: '(")'
endCaptures:
'1':
name: 'punctuation.definition.string.end.fluentd'
name: 'meta.value.string.quoted.double.fluentd'
patterns: [
{include: '#stringescapes'}
{include: '#stringinterpolations'}
]
}
{
begin: "(')"
beginCaptures:
'1':
name: 'punctuation.definition.string.begin.fluentd'
end: "(')"
endCaptures:
'1':
name: 'punctuation.definition.string.end.fluentd'
name: 'meta.value.string.quoted.single.fluentd'
patterns: [
{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: '\/.+\/$'
name: 'value.string.regex.fluentd'
}
{
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: '(\\$\\{[^\\}]*\\})'
name: 'variable.string.fluentd'
}
{
match: '([^\\s]+?)'
name: 'meta.string.unquoted.fluentd'
captures:
'1':
name: 'string.unquoted.fluentd'
}
]
stringescapes:
patterns: [
{
match: '\\\\.'
name: 'constant.string.escape.fluentd'
}
]
stringinterpolations:
patterns: [
{
begin: '#\\{'
end: '\\}'
name: 'constant.string.interpolation.fluentd'
patterns: [
{include: 'source.ruby'}
]
}
]