-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
source.toc.js
65 lines (63 loc) · 2.24 KB
/
source.toc.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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/nebularg/language-toc-wow>
// and licensed `unlicense`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: [],
names: ['world-of-warcraft-addon-data'],
patterns: [
{
captures: {
1: {name: 'keyword.tag.toc'},
2: {
name: 'keyword.tag.toc',
patterns: [
{match: '[Xx]-[^:]+', name: 'entity.name.tag.custom.toc'},
{
match:
'(?i)(Title-|Notes-|)(?-i)(enUS|enCN|enGB|enTW|frFR|deDE|esES|esMX|itIT|ptBR|ptPT|ruRU|koKR|zhTW|zhCN)',
name: 'entity.name.tag.localized.toc'
},
{
match:
'(?i)(Interface|Title|Notes|RequiredDeps|\\bDep[^:]*|OptionalDeps|LoadOnDemand|LoadWith|LoadManagers|SavedVariablesPerCharacter|SavedVariables|DefaultState|Author|Version|AddonCompartmentFunc|AddonCompartmentFuncOnEnter|AddonCompartmentFuncOnLeave|IconAtlas|IconTexture)',
name: 'entity.name.tag.toc'
},
{
match:
'(?i)(AllowLoad|OnlyBetaAndPTR|SavedVariablesMachine|Secure|GuardedAddOn)',
name: 'entity.name.tag.restricted.toc'
},
{match: '\\S[^:]+', name: 'invalid.tag.toc'}
]
},
3: {name: 'punctuation.separator.key-value'},
4: {
name: 'string.value.toc',
patterns: [
{
captures: {
1: {name: 'constant.character.escape.toc'},
2: {name: 'string.escape.coloring.toc'}
},
match: '(\\|c)([a-fA-F0-9]{8})'
},
{match: '(\\|r)', name: 'constant.character.escape.toc'},
{match: '@.*?@', name: 'constant.other.packager.toc'}
]
}
},
match: '^(##\\s*(\\S+))\\s*(:)\\s*(.*)$'
},
{match: '#.*$', name: 'comment.toc'},
{match: '^(?!#)[^ ].+\\.xml', name: 'meta.require.xml.toc'},
{match: '@.*?@', name: 'constant.other.packager.toc'}
],
scopeName: 'source.toc'
}
export default grammar