1
|
{"version":3,"file":"highlight/abnf.js?v=8418b3ca5aa2e0eeb3c4","mappings":"2GAoBA,SAASA,KAAUC,GAEjB,OADeA,EAAKC,KAAKC,IAAMC,OAZjBC,EAYwBF,GAVpB,iBAAPE,EAAwBA,EAE5BA,EAAGD,OAHM,KADlB,IAAgBC,KAY4BC,KAAK,IAiFjDC,EAAOC,QArEP,SAAcC,GACZ,MAAMC,EAAU,CACdC,gBAAiB,yBACjBC,gBAAiB,oBAsBbC,EAAcJ,EAAKK,QAAQ,IAAK,KAsBhCC,EAAsB,CAC1BC,UAAW,YACXC,MAAOjB,EAAOU,EAAQC,gBAAiB,aAGzC,MAAO,CACLO,KAAM,6BACNC,QAAST,EAAQE,gBACjBQ,SAjDe,CACf,QACA,MACA,OACA,KACA,OACA,MACA,QACA,SACA,SACA,OACA,KACA,OACA,QACA,KACA,QACA,OAkCAC,SAAU,CACRN,EACAF,EA/BuB,CACzBG,UAAW,SACXC,MAAO,sCAGmB,CAC1BD,UAAW,SACXC,MAAO,sCAGuB,CAC9BD,UAAW,SACXC,MAAO,+CAG4B,CACnCD,UAAW,SACXC,MAAO,SAmBLR,EAAKa,kBACLb,EAAKc","sources":["webpack:///text/node_modules/highlight.js/lib/languages/abnf.js"],"sourcesContent":["/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n if (!re) return null;\n if (typeof re === \"string\") return re;\n\n return re.source;\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n const joined = args.map((x) => source(x)).join(\"\");\n return joined;\n}\n\n/*\nLanguage: Augmented Backus-Naur Form\nAuthor: Alex McKibben <alex@nullscope.net>\nWebsite: https://tools.ietf.org/html/rfc5234\nAudit: 2020\n*/\n\n/** @type LanguageFn */\nfunction abnf(hljs) {\n const regexes = {\n ruleDeclaration: /^[a-zA-Z][a-zA-Z0-9-]*/,\n unexpectedChars: /[!@#$^&',?+~`|:]/\n };\n\n const keywords = [\n \"ALPHA\",\n \"BIT\",\n \"CHAR\",\n \"CR\",\n \"CRLF\",\n \"CTL\",\n \"DIGIT\",\n \"DQUOTE\",\n \"HEXDIG\",\n \"HTAB\",\n \"LF\",\n \"LWSP\",\n \"OCTET\",\n \"SP\",\n \"VCHAR\",\n \"WSP\"\n ];\n\n const commentMode = hljs.COMMENT(/;/, /$/);\n\n const terminalBinaryMode = {\n className: \"symbol\",\n begin: /%b[0-1]+(-[0-1]+|(\\.[0-1]+)+){0,1}/\n };\n\n const terminalDecimalMode = {\n className: \"symbol\",\n begin: /%d[0-9]+(-[0-9]+|(\\.[0-9]+)+){0,1}/\n };\n\n const terminalHexadecimalMode = {\n className: \"symbol\",\n begin: /%x[0-9A-F]+(-[0-9A-F]+|(\\.[0-9A-F]+)+){0,1}/\n };\n\n const caseSensitivityIndicatorMode = {\n className: \"symbol\",\n begin: /%[si]/\n };\n\n const ruleDeclarationMode = {\n className: \"attribute\",\n begin: concat(regexes.ruleDeclaration, /(?=\\s*=)/)\n };\n\n return {\n name: 'Augmented Backus-Naur Form',\n illegal: regexes.unexpectedChars,\n keywords: keywords,\n contains: [\n ruleDeclarationMode,\n commentMode,\n terminalBinaryMode,\n terminalDecimalMode,\n terminalHexadecimalMode,\n caseSensitivityIndicatorMode,\n hljs.QUOTE_STRING_MODE,\n hljs.NUMBER_MODE\n ]\n };\n}\n\nmodule.exports = abnf;\n"],"names":["concat","args","map","x","source","re","join","module","exports","hljs","regexes","ruleDeclaration","unexpectedChars","commentMode","COMMENT","ruleDeclarationMode","className","begin","name","illegal","keywords","contains","QUOTE_STRING_MODE","NUMBER_MODE"],"sourceRoot":""}
|