UNPKG

753 BJavaScriptView Raw
1hljs.registerLanguage("abnf",(()=>{"use strict";function e(...e){
2return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t
3})).join("")}return t=>{const s=t.COMMENT(/;/,/$/);return{
4name:"Augmented Backus-Naur Form",illegal:/[!@#$^&',?+~`|:]/,
5keywords:["ALPHA","BIT","CHAR","CR","CRLF","CTL","DIGIT","DQUOTE","HEXDIG","HTAB","LF","LWSP","OCTET","SP","VCHAR","WSP"],
6contains:[{scope:"operator",match:/=\/?/},{scope:"attribute",
7match:e(/^[a-zA-Z][a-zA-Z0-9-]*/,/(?=\s*=)/)},s,{scope:"symbol",
8match:/%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/},{scope:"symbol",
9match:/%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/},{scope:"symbol",
10match:/%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/},{scope:"symbol",
11match:/%[si](?=".*")/},t.QUOTE_STRING_MODE,t.NUMBER_MODE]}}})());
\No newline at end of file