-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
source.win32-messages.js
81 lines (79 loc) · 2.45 KB
/
source.win32-messages.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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/Nixinova/NovaGrammars>
// and licensed `isc`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: [],
names: ['win32-message-file'],
patterns: [{include: '#main'}],
repository: {
comment: {
begin: ';',
beginCaptures: {
0: {name: 'punctuation.definition.comment.win32-messages'}
},
end: '$',
name: 'meta.comment.line.semicolon.win32-messages',
patterns: [{include: 'source.c'}]
},
delim: {match: '^\\.$', name: 'meta.separator.win32-messages'},
insert: {
captures: {
1: {name: 'constant.language.insert.win32-messages'},
2: {name: 'entity.name.tag.insert.format.win32-messages'},
3: {name: 'punctuation.definition.insert.format.begin.win32-messages'},
4: {name: 'punctuation.definition.insert.format.end.win32-messages'}
},
match: '(?x) (%(?:.|\\d{1,2})) ((!)(\\w+)(!))? ',
name: 'meta.line.insert.win32-messages'
},
main: {
patterns: [
{include: '#comment'},
{include: '#insert'},
{include: '#message'},
{include: '#statement'}
]
},
message: {match: '^[^=]+$', name: 'string.unquoted.message.win32-messages'},
statement: {
patterns: [
{
captures: {
1: {name: 'punctuation.definition.statement.win32-messages'}
},
match: '[^=()]+(?=(=))',
name: 'keyword.control.statement.win32-messages'
},
{match: '(?:0\\w)?\\d+', name: 'constant.numeric.win32-messages'},
{
begin: '(?<==)(?!\\()',
beginCaptures: {
0: {name: 'punctuation.definition.statement.win32-messages'}
},
end: '$',
name: 'string.unquoted.value.win32-messages'
},
{
begin: '(?<==)\\(',
beginCaptures: {
0: {name: 'punctuation.definition.block.group.begin.win32-messages'}
},
end: '\\)',
endCaptures: {
0: {name: 'punctuation.definition.block.group.end.win32-messages'}
},
name: 'meta.block.statement.value.win32-messages',
patterns: [{include: '#statement'}]
}
]
}
},
scopeName: 'source.win32-messages'
}
export default grammar