ini.min.js 1.0 KB

123456789101112131415
  1. /*! `ini` grammar compiled for Highlight.js 11.7.0 */
  2. (()=>{var e=(()=>{"use strict";return e=>{const n=e.regex,a={className:"number",
  3. relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]
  4. },s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={
  5. className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/
  6. }]},t={className:"literal",begin:/\bon|off|true|false|yes|no\b/},r={
  7. className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",
  8. end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'
  9. },{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[s,t,i,r,a,"self"],
  10. relevance:0},c=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{
  11. name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,
  12. contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{
  13. begin:n.concat(c,"(\\s*\\.\\s*",c,")*",n.lookahead(/\s*=\s*[^#\s]/)),
  14. className:"attr",starts:{end:/$/,contains:[s,l,t,i,r,a]}}]}}})()
  15. ;hljs.registerLanguage("ini",e)})();