Compare commits

...

14 Commits

Author SHA1 Message Date
cn a3f374d1aa Prepare 1.1.3 release 2018-03-16 22:35:52 +01:00
cn 4dcaaa2215 grammar: support numeric-only TTL values 2018-03-16 22:35:13 +01:00
cn 17de36de6a Prepare 1.1.2 release 2018-02-21 21:24:13 +01:00
cn 850310d9aa package: add keywords 2018-02-21 21:23:52 +01:00
cn ba4ff2d73a docs: fix CHANGELOG 2018-01-29 20:44:34 +01:00
cn 3dbb38df8b Prepare 1.1.1 release 2018-01-29 20:43:08 +01:00
cn 1f64694e75 grammar: make resource record class (like `IN`) optional 2018-01-29 20:39:19 +01:00
cn 95a07e54a5 Prepare 1.1.0 release 2017-11-26 17:32:55 +01:00
cn 1f77d6ab0f docs: add installation instructions and screenshot 2017-11-26 17:32:35 +01:00
cn c476fe63f0 grammar: refactor internal structure removing duplication and allowing for new features 2017-11-26 17:05:39 +01:00
cn e95220d3a9 docs: add example zone file for testing 2017-11-26 15:57:31 +01:00
cn 23340d3123 settings: support toggling comments 2017-11-26 15:55:05 +01:00
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
cn 265e488e96 grammar: remove duplicate comment handling 2017-11-26 15:40:02 +01:00
7 changed files with 166 additions and 46 deletions

View File

@ -1,5 +1,37 @@
# Changelog
## 1.1.3 (March 16, 2018)
IMPROVEMENTS:
- Support numeric-only TTL values
## 1.1.2 (February 21, 2018)
IMPROVEMENTS:
- Add package keywords
## 1.1.1 (January 29, 2018)
IMPROVEMENTS:
- Make resource record class (like `IN`) optional
## 1.1.0 (November 26, 2017)
NEW FEATURES:
- Support toggling comments
- Support `CH` resource record class in addition to `IN`
- Support `"..."` strings correctly in resource data
- Support `\X` escape sequences in resource data
IMPROVEMENTS:
- Add example zone file using many possibilities offered by RFC 1035 syntax (even if this package does not highlight it correctly)
- Add installation instructions and screenshot
## 1.0.0 (November 11, 2017)
NEW FEATURES:

View File

@ -2,6 +2,22 @@
Adds basic syntax highlighting based on the [Sublime Text package](https://github.com/sixty4k/st2-zonefile) to zone files in Atom.
![Screenshot](/screenshot.png?raw=true)
## Installation
Available as [Atom package](https://atom.io/packages/language-zonefile):
```
apm install language-zonefile
```
Or directly via git:
```
git clone https://github.com/cmur2/language-zonefile.git ~/.atom/packages/language-zonefile
```
## License
language-zonefile is licensed under the MIT License. See LICENSE for more information.

37
example.zone Normal file
View File

@ -0,0 +1,37 @@
$TTL 86400 ; 24 hours, could have been written as 24h or 1d
$ORIGIN example.com.
@ 7d IN SOA ns1.example.com. hostmaster.example.com. (
2017010101 ; serial
3H ; refresh
15 ; retry
1W ; expire
5m ; minimum
)
; name servers
7D IN NS ns1.example.com. ; in the domain
7D IN NS ns2.example.org. ; external to domain
; services and hosts
ns1 IN A 192.168.0.1 ; name server IPv4 address
ns1 IN AAAA 2001:0db8::1 ; name server IPv6 address
www IN A 192.168.0.2 ; web server
ftp IN CNAME www.example.com. ; ftp alias (absolute)
xmpp IN CNAME www ; xmpp alias (relative)
dyn 60 IN CNAME www ; dynamic alias (TTL in seconds)
; mail
IN MX 10 mail.example.org. ; external mail provider
mail._domainkey IN TXT "v=DKIM1\; h=sha256\; k=rsa\; s=email\; p=loooooooooog"
; CAA records for Let's Encrypt, one in RFC 3597 syntax
IN CAA 0 issue "letsencrypt.org"
; IN CAA 0 iodef "mailto:abuse@example.com"
IN TYPE257 \# 31 0005696F6465666D61696C746F3A6162757365406578616D706C652E636F6D
; xmpp
_jabber._tcp IN SRV 5 0 5269 xmpp
; special
xx.lcs.mit.edu. CH A mit.edu. 2420

View File

@ -4,55 +4,80 @@ fileTypes: [
'zone'
'db'
]
patterns: [
{
match: ';.*'
name: 'comment.line.semicolon.zonefile'
}
{
match: '@'
name: 'keyword.directive.zonefile'
}
{
match: '\\$(ORIGIN|origin|TTL|ttl|INCLUDE|include)\\s*([^;]*)(;.*)?'
name: 'keyword.directive.zonefile'
captures:
'2':
name: 'variable.other.directive.zonefile'
'3':
name: 'comment.line.semicolon.zonefile'
}
{
match: '\\d+(H|h|D|d|W|w|M|m|Y|y)'
name: 'variable.other.timeunit.zonefile'
}
{
begin: '([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*)\\('
beginCaptures:
'2':
name: 'variable.other.timeunit.zonefile'
'3':
name: 'keyword.resourcetype.zonefile'
'4':
name: 'string.quoted.single.resource.address.zonefile'
end: '\\)'
name: 'string.quoted.single.address.zonefile'
{include: '#comments'}
{include: '#entries'}
]
repository:
comments:
patterns: [
{
match: ';.*'
name: 'comment.line.semicolon.zonefile'
}
]
}
{
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:
'2':
name: 'variable.other.timeunit.zonefile'
'3':
name: 'keyword.resourcetype.zonefile'
'4':
name: 'string.quoted.single.resource.address.zonefile'
}
]
entries:
patterns: [
{
match: '(\\$(ORIGIN|origin|TTL|ttl|INCLUDE|include))\\s+([^;]+)'
captures:
'1':
name: 'keyword.entry.control.zonefile'
'3':
name: 'variable.other.entry.control.zonefile'
}
{
begin: '((@)|([A-Za-z0-9_.-]+))?(\\s+\\d+[A-Za-z]*)?(\\s+IN|in|CH|ch)?\\s+(\\w+)\\s+'
beginCaptures:
'2':
name: 'keyword.entry.resource.record.zonefile'
'3':
name: 'string.unquoted.domain.name.zonefile'
'4':
name: 'variable.other.ttl.zonefile'
'5':
name: 'keyword.class.zonefile'
'6':
name: 'keyword.resource.type.zonefile'
end: '\\n'
name: 'meta.entry.resource.record.zonefile'
patterns: [
{include: '#comments'}
{include: '#rdata'}
]
}
]
rdata:
patterns: [
{
match: '(\\\\([^\\d]|[\\d]{3,3}))'
name: 'string.unquoted.escape.zonefile'
captures:
'1':
name: 'constant.string.unquoted.escape.zonefile'
}
{
match: '"[^"]*"'
name: 'string.quoted.double.resource.data.zonefile'
}
{
begin: '(\\()'
beginCaptures:
'1':
name: 'string.unquoted.resource.data.zonefile'
end: '(\\))'
endCaptures:
'1':
name: 'string.unquoted.resource.data.zonefile'
patterns: [
{include: '#comments'}
{include: '#rdata'}
]
}
{
match: '[^\\s]+?'
name: 'string.unquoted.resource.data.zonefile'
}
]

View File

@ -1,7 +1,14 @@
{
"name": "language-zonefile",
"description": "Bind Zone File language support in Atom",
"version": "1.0.0",
"version": "1.1.3",
"keywords": [
"language",
"grammar",
"dns",
"zonefile",
"bind"
],
"engines": {
"atom": "*"
},

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -0,0 +1,3 @@
'.source.zonefile':
editor:
commentStart: '; '