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
This commit is contained in:
cn 2017-11-26 15:44:25 +01:00
parent 265e488e96
commit de74c1f66c
1 changed files with 24 additions and 14 deletions

View File

@ -11,46 +11,56 @@ patterns: [
} }
{ {
match: '@' match: '@'
name: 'keyword.directive.zonefile' name: 'keyword.entry.control.zonefile'
} }
{ {
name: 'keyword.directive.zonefile'
match: '\\$(ORIGIN|origin|TTL|ttl|INCLUDE|include)\\s+([^;]*)' match: '\\$(ORIGIN|origin|TTL|ttl|INCLUDE|include)\\s+([^;]*)'
name: 'keyword.entry.control.zonefile'
captures: captures:
'2': '2':
name: 'variable.other.directive.zonefile' name: 'variable.other.entry.control.zonefile'
} }
{ {
match: '\\d+(H|h|D|d|W|w|M|m|Y|y)' match: '\\d+(H|h|D|d|W|w|M|m|Y|y)'
name: 'variable.other.timeunit.zonefile' 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+(.*)\\(' begin: '([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*\\()'
beginCaptures: beginCaptures:
'1':
name: 'string.unquoted.domain.name.zonefile'
'2': '2':
name: 'variable.other.timeunit.zonefile' name: 'variable.other.ttl.zonefile'
'3': '3':
name: 'keyword.resourcetype.zonefile' name: 'keyword.resource.type.zonefile'
'4': '4':
name: 'string.quoted.single.resource.address.zonefile' name: 'string.quoted.resource.data.zonefile'
end: '\\)' end: '(\\))'
name: 'string.quoted.single.address.zonefile' endCaptures:
'1':
name: 'string.quoted.resource.data.zonefile'
name: 'meta.entry.resource.record'
patterns: [ patterns: [
{ {
match: ';.*' match: ';.*'
name: 'comment.line.semicolon.zonefile' 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+(.*)' match: '([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*)'
name: 'string.quoted.single.address.zonefile'
captures: captures:
'1':
name: 'string.unquoted.domain.name.zonefile'
'2': '2':
name: 'variable.other.timeunit.zonefile' name: 'variable.other.ttl.zonefile'
'3': '3':
name: 'keyword.resourcetype.zonefile' name: 'keyword.resource.type.zonefile'
'4': '4':
name: 'string.quoted.single.resource.address.zonefile' name: 'string.unquoted.resource.data.zonefile'
} }
] ]