-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGnosum.sublime-syntax
56 lines (49 loc) · 1.42 KB
/
Gnosum.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%YAML 1.2
---
# License: https://github.com/mitranim/sublime-gomod#misc
file_extensions: [gno.sum]
scope: source.gnosum
variables:
ident: (?:[^\s/()]|/(?!/))+
semver: v\d+\.\d+\.\d+
version_checksum: '[^\s/]+'
checksum: '\S+'
algorithm: \w+
contexts:
# The form of each line in go.sum is three fields:
#
# <module> <version>[/go.mod] <hash>
#
# Each known module version results in two lines in the go.sum file.
# The first line gives the hash of the module version's file tree.
# The second line appends "/go.mod" to the version and gives the hash
# of only the module version's (possibly synthesized) go.mod file.
#
# The hash begins with an algorithm prefix of the form "h<N>:".
main:
- include: module-match
eol-pop:
- match: $
pop: true
module-match:
- match: \S+
scope: variable.gnosum
set: version-match
version-match:
- include: eol-pop
- match: ({{semver}})(?:([+-])({{version_checksum}}))?(?:(/)({{ident}}))?
captures:
1: string.version.gnosum
2: punctuation.separator.gnosum
3: string.checksum.gnosum
4: punctuation.separator.gnosum
5: variable.gnosum
- match: (?=\S)
set: checksum-match
checksum-match:
- include: eol-pop
- match: ({{algorithm}})(:)({{checksum}})
captures:
1: entity.name.label.gnosum
2: punctuation.separator.gnosum
3: constant.language.gnosum