source: node_modules/refractor/lang/dns-zone-file.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1'use strict'
2
3module.exports = dnsZoneFile
4dnsZoneFile.displayName = 'dnsZoneFile'
5dnsZoneFile.aliases = []
6function dnsZoneFile(Prism) {
7 Prism.languages['dns-zone-file'] = {
8 comment: /;.*/,
9 string: {
10 pattern: /"(?:\\.|[^"\\\r\n])*"/,
11 greedy: true
12 },
13 variable: [
14 {
15 pattern: /(^\$ORIGIN[ \t]+)\S+/m,
16 lookbehind: true
17 },
18 {
19 pattern: /(^|\s)@(?=\s|$)/,
20 lookbehind: true
21 }
22 ],
23 keyword: /^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,
24 class: {
25 // https://tools.ietf.org/html/rfc1035#page-13
26 pattern: /(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,
27 lookbehind: true,
28 alias: 'keyword'
29 },
30 type: {
31 // https://en.wikipedia.org/wiki/List_of_DNS_record_types
32 pattern:
33 /(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,
34 lookbehind: true,
35 alias: 'keyword'
36 },
37 punctuation: /[()]/
38 }
39 Prism.languages['dns-zone'] = Prism.languages['dns-zone-file']
40}
Note: See TracBrowser for help on using the repository browser.