nginx.min.js 1.6 KB

123456789101112131415161718192021
  1. /*! `nginx` grammar compiled for Highlight.js 11.7.0 */
  2. (()=>{var e=(()=>{"use strict";return e=>{const n=e.regex,a={
  3. className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{\w+\}/},{
  4. begin:n.concat(/[$@]/,e.UNDERSCORE_IDENT_RE)}]},s={endsWithParent:!0,keywords:{
  5. $pattern:/[a-z_]{2,}|\/dev\/poll/,
  6. literal:["on","off","yes","no","true","false","none","blocked","debug","info","notice","warn","error","crit","select","break","last","permanent","redirect","kqueue","rtsig","epoll","poll","/dev/poll"]
  7. },relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string",
  8. contains:[e.BACKSLASH_ESCAPE,a],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/
  9. }]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[a]
  10. },{className:"regexp",contains:[e.BACKSLASH_ESCAPE,a],variants:[{begin:"\\s\\^",
  11. end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{
  12. begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",
  13. begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{
  14. className:"number",begin:"\\b\\d+[kKmMgGdshdwy]?\\b",relevance:0},a]};return{
  15. name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{
  16. beginKeywords:"upstream location",end:/;|\{/,contains:s.contains,keywords:{
  17. section:"upstream location"}},{className:"section",
  18. begin:n.concat(e.UNDERSCORE_IDENT_RE+n.lookahead(/\s+\{/)),relevance:0},{
  19. begin:n.lookahead(e.UNDERSCORE_IDENT_RE+"\\s"),end:";|\\{",contains:[{
  20. className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:s}],relevance:0}],
  21. illegal:"[^\\s\\}\\{]"}}})();hljs.registerLanguage("nginx",e)})();