summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-go-module.min.js
blob: 4bb1d743d39bff6bd2cccd621b1201d28c9db95c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Prism.languages['go-mod'] = Prism.languages['go-module'] = {
  comment: { pattern: /\/\/.*/, greedy: !0 },
  version: {
    pattern: /(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/,
    lookbehind: !0,
    alias: 'number',
  },
  'go-version': {
    pattern: /((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/,
    lookbehind: !0,
    alias: 'number',
  },
  keyword: {
    pattern: /^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m,
    lookbehind: !0,
  },
  operator: /=>/,
  punctuation: /[()[\],]/,
};
pan>operator: /\*$/, }, }, // We don't want to highlight operators (and anything really) inside backticks identifier: { pattern: /`[^`\r\n]+`/, greedy: true, inside: { punctuation: /`/, }, }, // The negative look ahead prevents wrong highlighting of the .. operator number: /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/, keyword: /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/, operator: { // Look behind and look ahead prevent wrong highlighting of punctuations [. .] {. .} (. .) // but allow the slice operator .. to take precedence over them // One can define his own operators in Nim so all combination of operators might be an operator. pattern: /(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|in|is|isnot|mod|not|notin|of|or|shl|shr|xor)\b)/m, lookbehind: true, }, punctuation: /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/, };