mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 12:53:41 +08:00
f3dee5863f
The 10+ version has actually a bug with bash. We will wait a little bit before upgrading to 10, we should also make sure any of the breaking changes listed here https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_BREAKING_CHANGES.md are not impacting us.
1 line
1.3 KiB
JavaScript
1 line
1.3 KiB
JavaScript
hljs.registerLanguage("erlang",function(e){var r="[a-z'][a-zA-Z0-9_']*",c="("+r+":"+r+"|"+r+")",n={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",literal:"false true"},a=e.C("%","$"),b={cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",relevance:0},i={b:"fun\\s+"+r+"/\\d+"},l={b:c+"\\(",e:"\\)",rB:!0,relevance:0,c:[{b:c,relevance:0},{b:"\\(",e:"\\)",eW:!0,rE:!0,relevance:0}]},d={b:"{",e:"}",relevance:0},o={b:"\\b_([A-Z][A-Za-z0-9_]*)?",relevance:0},t={b:"[A-Z][a-zA-Z0-9_]*",relevance:0},v={b:"#"+e.UIR,relevance:0,rB:!0,c:[{b:"#"+e.UIR,relevance:0},{b:"{",e:"}",relevance:0}]},f={bK:"fun receive if try case",e:"end",k:n};f.c=[a,i,e.inherit(e.ASM,{cN:""}),f,l,e.QSM,b,d,o,t,v];var s=[a,i,f,l,e.QSM,b,d,o,t,v];l.c[1].c=s,d.c=s;var u={cN:"params",b:"\\(",e:"\\)",c:v.c[1].c=s};return{aliases:["erl"],k:n,i:"(</|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))",c:[{cN:"function",b:"^"+r+"\\s*\\(",e:"->",rB:!0,i:"\\(|#|//|/\\*|\\\\|:|;",c:[u,e.inherit(e.TM,{b:r})],starts:{e:";|\\.",k:n,c:s}},a,{b:"^-",e:"\\.",relevance:0,eE:!0,rB:!0,l:"-"+e.IR,k:"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior -spec",c:[u]},b,e.QSM,v,o,t,d,{b:/\.$/}]}}); |