UNPKG

590 BJavaScriptView Raw
1hljs.registerLanguage("json",(()=>{"use strict";return n=>{const e={
2literal:"true false null"
3},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],a=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],l={
4end:",",endsWithParent:!0,excludeEnd:!0,contains:a,keywords:e},t={begin:/\{/,
5end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,
6contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(l,{begin:/:/
7})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(l)],
8illegal:"\\S"};return a.push(t,s),i.forEach((n=>{a.push(n)})),{name:"JSON",
9contains:a,keywords:e,illegal:"\\S"}}})());
\No newline at end of file