-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
source.deb-control.js
109 lines (107 loc) · 3.44 KB
/
source.deb-control.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/tsbarnes/language-debian>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.dsc'],
names: ['debian-package-control-file'],
patterns: [{include: '#paragraphs'}],
repository: {
comments: {match: '^#.*$', name: 'comment.line.deb-control'},
fields: {
patterns: [
{
begin:
'^(Package|Version|Architecture|Maintainer|Source|Section|Priority|Essential|Installed-Size|Homepage|Built-Using|Standards-Version)(:)',
beginCaptures: {
1: {name: 'entity.name.section.field.simple.deb-control'},
2: {name: 'keyword.operator.deb-control'}
},
end: '\\n',
name: 'meta.section.field.simple.deb-control',
patterns: [{include: '#variables'}]
},
{
begin: '^(Depends|Build-Depends)(:)',
beginCaptures: {
1: {name: 'entity.name.section.field.folded.deb-control'},
2: {name: 'keyword.operator.deb-control'}
},
end: '^(?!\\s)',
name: 'meta.section.field.folded.deb-control',
patterns: [{include: '#comments'}, {include: '#variables'}]
},
{
begin: '^(Description)(:)',
beginCaptures: {
1: {name: 'entity.name.section.field.multiline.deb-control'},
2: {name: 'keyword.operator.deb-control'}
},
end: '^(?!\\s)',
name: 'meta.section.field.multiline.deb-control',
patterns: [{include: '#comments'}, {include: '#variables'}]
},
{
begin: '^([^:\\s]*)(:)',
beginCaptures: {
1: {
patterns: [
{
captures: {
1: {name: 'entity.name.section.field.unknown.deb-control'},
2: {name: 'keyword.operator.deb-control'}
},
match: '^([a-zA-Z0-9][a-zA-Z0-9\\-]*)'
},
{
captures: {
1: {name: 'invalid.illegal.name.section.field.deb-control'},
2: {name: 'keyword.operator.deb-control'}
},
match: '^([^a-zA-Z0-9].*)'
},
{
captures: {
1: {name: 'invalid.illegal.name.section.field.deb-control'},
2: {name: 'keyword.operator.deb-control'}
},
match: '^([a-zA-Z0-9].*[^a-zA-Z0-9\\-]*.*)'
}
]
},
2: {name: 'keyword.operator.deb-control'}
},
end: '^(?!\\s)',
name: 'meta.section.field.multiline.deb-control',
patterns: [{include: '#comments'}, {include: '#variables'}]
}
]
},
paragraphs: {
patterns: [
{
begin: '^(?!\\s)',
end: '^$',
name: 'meta.section.paragraph.deb-control',
patterns: [{include: '#comments'}, {include: '#fields'}]
}
]
},
variables: {
patterns: [
{
begin: '\\${',
end: '}',
name: 'variable.other.substitution.deb-control'
}
]
}
},
scopeName: 'source.deb-control'
}
export default grammar