erlang.min.js 2.0 KB

123456789101112131415161718192021222324252627
  1. /*! `erlang` grammar compiled for Highlight.js 11.7.0 */
  2. var hljsGrammar=(()=>{"use strict";return e=>{
  3. const n="[a-z'][a-zA-Z0-9_']*",r="("+n+":"+n+"|"+n+")",a={
  4. keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor",
  5. literal:"false true"},i=e.COMMENT("%","$"),s={className:"number",
  6. begin:"\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",
  7. relevance:0},t={begin:"fun\\s+"+n+"/\\d+"},c={begin:r+"\\(",end:"\\)",
  8. returnBegin:!0,relevance:0,contains:[{begin:r,relevance:0},{begin:"\\(",
  9. end:"\\)",endsWithParent:!0,returnEnd:!0,relevance:0}]},d={begin:/\{/,end:/\}/,
  10. relevance:0},o={begin:"\\b_([A-Z][A-Za-z0-9_]*)?",relevance:0},l={
  11. begin:"[A-Z][a-zA-Z0-9_]*",relevance:0},b={begin:"#"+e.UNDERSCORE_IDENT_RE,
  12. relevance:0,returnBegin:!0,contains:[{begin:"#"+e.UNDERSCORE_IDENT_RE,
  13. relevance:0},{begin:/\{/,end:/\}/,relevance:0}]},g={
  14. beginKeywords:"fun receive if try case",end:"end",keywords:a}
  15. ;g.contains=[i,t,e.inherit(e.APOS_STRING_MODE,{className:""
  16. }),g,c,e.QUOTE_STRING_MODE,s,d,o,l,b]
  17. ;const E=[i,t,g,c,e.QUOTE_STRING_MODE,s,d,o,l,b]
  18. ;c.contains[1].contains=E,d.contains=E,b.contains[1].contains=E;const u={
  19. className:"params",begin:"\\(",end:"\\)",contains:E};return{name:"Erlang",
  20. aliases:["erl"],keywords:a,illegal:"(</|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))",
  21. contains:[{className:"function",begin:"^"+n+"\\s*\\(",end:"->",returnBegin:!0,
  22. illegal:"\\(|#|//|/\\*|\\\\|:|;",contains:[u,e.inherit(e.TITLE_MODE,{begin:n})],
  23. starts:{end:";|\\.",keywords:a,contains:E}},i,{begin:"^-",end:"\\.",relevance:0,
  24. excludeEnd:!0,returnBegin:!0,keywords:{$pattern:"-"+e.IDENT_RE,
  25. keyword:["-module","-record","-undef","-export","-ifdef","-ifndef","-author","-copyright","-doc","-vsn","-import","-include","-include_lib","-compile","-define","-else","-endif","-file","-behaviour","-behavior","-spec"].map((e=>e+"|1.5")).join(" ")
  26. },contains:[u]},s,e.QUOTE_STRING_MODE,b,o,l,d,{begin:/\.$/}]}}})()
  27. ;export default hljsGrammar;