go.min.js 1.2 KB

1234567891011121314
  1. /*! `go` grammar compiled for Highlight.js 11.7.0 */
  2. var hljsGrammar=(()=>{"use strict";return e=>{const n={
  3. keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],
  4. type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],
  5. literal:["true","false","iota","nil"],
  6. built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]
  7. };return{name:"Go",aliases:["golang"],keywords:n,illegal:"</",
  8. contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",
  9. variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{
  10. className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1
  11. },e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",
  12. end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",
  13. begin:/\(/,end:/\)/,endsParent:!0,keywords:n,illegal:/["']/}]}]}}})()
  14. ;export default hljsGrammar;