-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
source.gemfile-lock.js
76 lines (74 loc) · 2.22 KB
/
source.gemfile-lock.js
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/hmarr/gemfile-lock-tmlanguage>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: [],
names: ['gemfile.lock'],
patterns: [{include: '#dependencies-sections'}, {include: '#other-sections'}],
repository: {
'dependencies-sections': {
begin: '^(GEM|PATH|GIT|DEPENDENCIES)$',
beginCaptures: {0: {name: 'keyword.control.section.gemfile-lock'}},
end: '^$',
name: 'section.gemfile-lock',
patterns: [{include: '#entries'}, {include: '#dependency-specs'}]
},
'dependency-specs': {
patterns: [
{
begin: '^ {2,6}([^ !]+)\\s*(\\()?',
beginCaptures: {
1: {name: 'entity.package.gemfile-lock'},
2: {name: 'punctuation.parenthesis.begin.gemfile-lock'}
},
end: '($|\\))',
endCaptures: {1: {name: 'punctuation.parenthesis.end.gemfile-lock'}},
name: 'dependency.gemfile-lock',
patterns: [{include: '#versions'}]
}
]
},
entries: {
patterns: [
{
captures: {
1: {name: 'meta.property-name.gemfile-lock'},
2: {name: 'string.gemfile-lock'}
},
match: '^ +([a-z]+:) ?(.*)$',
name: 'entry.gemfile-lock'
}
]
},
'other-sections': {
begin: '^[A-Z ]+$',
beginCaptures: {0: {name: 'keyword.control.section.gemfile-lock'}},
end: '^$',
name: 'section.gemfile-lock',
patterns: [
{captures: {1: {name: 'string.gemfile-lock'}}, match: '^\\s+(.*)$'}
]
},
versions: {
patterns: [
{
captures: {
1: {name: 'keyword.operator.comparison.gemfile-lock'},
2: {name: 'constant.numeric.gemfile-lock'},
3: {name: 'punctuation.separator.gemfile-lock'}
},
match: '(?:(<=|>=|=|~>|<|>|!=) )?([0-9A-Za-z_\\-\\.]+)(,)?',
name: 'version.gemfile-lock'
}
]
}
},
scopeName: 'source.gemfile-lock'
}
export default grammar