ini.min.js 1.0 KB

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