1
0
mirror of https://github.com/cmur2/language-zonefile.git synced 2024-12-22 02:54:25 +01:00
language-zonefile/grammars/zonefile.cson
cn de74c1f66c grammar: change scope selectors to match RFC 1035 terminology for easier understanding
Note: the pattern structure changed a bit to allow precise application of scope selectors
2017-11-26 15:44:31 +01:00

67 lines
1.5 KiB
Plaintext

scopeName: 'source.zonefile'
name: 'Bind Zone File'
fileTypes: [
'zone'
'db'
]
patterns: [
{
match: ';.*'
name: 'comment.line.semicolon.zonefile'
}
{
match: '@'
name: 'keyword.entry.control.zonefile'
}
{
match: '\\$(ORIGIN|origin|TTL|ttl|INCLUDE|include)\\s+([^;]*)'
name: 'keyword.entry.control.zonefile'
captures:
'2':
name: 'variable.other.entry.control.zonefile'
}
{
match: '\\d+(H|h|D|d|W|w|M|m|Y|y)'
name: 'variable.other.ttl.zonefile'
}
{
begin: '([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*\\()'
beginCaptures:
'1':
name: 'string.unquoted.domain.name.zonefile'
'2':
name: 'variable.other.ttl.zonefile'
'3':
name: 'keyword.resource.type.zonefile'
'4':
name: 'string.quoted.resource.data.zonefile'
end: '(\\))'
endCaptures:
'1':
name: 'string.quoted.resource.data.zonefile'
name: 'meta.entry.resource.record'
patterns: [
{
match: ';.*'
name: 'comment.line.semicolon.zonefile'
}
{
match: '[^\\)]+?'
name: 'string.quoted.resource.data.zonefile'
}
]
}
{
match: '([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*)'
captures:
'1':
name: 'string.unquoted.domain.name.zonefile'
'2':
name: 'variable.other.ttl.zonefile'
'3':
name: 'keyword.resource.type.zonefile'
'4':
name: 'string.unquoted.resource.data.zonefile'
}
]