source: node_modules/refractor/lang/go-module.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 745 bytes
RevLine 
[d24f17c]1'use strict'
2
3module.exports = goModule
4goModule.displayName = 'goModule'
5goModule.aliases = []
6function goModule(Prism) {
7 // https://go.dev/ref/mod#go-mod-file-module
8 Prism.languages['go-mod'] = Prism.languages['go-module'] = {
9 comment: {
10 pattern: /\/\/.*/,
11 greedy: true
12 },
13 version: {
14 pattern: /(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/,
15 lookbehind: true,
16 alias: 'number'
17 },
18 'go-version': {
19 pattern: /((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/,
20 lookbehind: true,
21 alias: 'number'
22 },
23 keyword: {
24 pattern: /^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m,
25 lookbehind: true
26 },
27 operator: /=>/,
28 punctuation: /[()[\],]/
29 }
30}
Note: See TracBrowser for help on using the repository browser.