-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
text.xml.ant.js
109 lines (107 loc) · 3.41 KB
/
text.xml.ant.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 licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
dependencies: ['text.xml'],
extensions: [],
names: ['ant-build-system'],
patterns: [
{
begin: '<[!%]--',
captures: {0: {name: 'punctuation.definition.comment.xml.ant'}},
end: '--%?>',
name: 'comment.block.xml.ant'
},
{
begin: '(<target)\\b',
captures: {1: {name: 'entity.name.tag.target.xml.ant'}},
end: '(/?>)',
name: 'meta.tag.target.xml.ant',
patterns: [{include: '#tagStuff'}]
},
{
begin: '(<macrodef)\\b',
captures: {1: {name: 'entity.name.tag.macrodef.xml.ant'}},
end: '(/?>)',
name: 'meta.tag.macrodef.xml.ant',
patterns: [{include: '#tagStuff'}]
},
{
begin: '(</?)(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+)',
captures: {
1: {name: 'punctuation.definition.tag.xml.ant'},
2: {name: 'entity.name.tag.namespace.xml.ant'},
3: {name: 'entity.name.tag.xml.ant'},
4: {name: 'punctuation.separator.namespace.xml.ant'},
5: {name: 'entity.name.tag.localname.xml.ant'}
},
end: '(/?>)',
name: 'meta.tag.xml.ant',
patterns: [{include: '#tagStuff'}]
},
{include: 'text.xml'},
{include: '#javaProperties'},
{include: '#javaAttributes'}
],
repository: {
doublequotedString: {
begin: '"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.xml.ant'}},
end: '"',
endCaptures: {0: {name: 'punctuation.definition.string.end.xml.ant'}},
name: 'string.quoted.double.xml.ant',
patterns: [{include: '#javaAttributes'}, {include: '#javaProperties'}]
},
javaAttributes: {
begin: '@\\{',
beginCaptures: {0: {name: 'punctuation.section.embedded.begin.ant'}},
contentName: 'source.java',
end: '(\\})',
endCaptures: {
0: {name: 'punctuation.section.embedded.end.ant'},
1: {name: 'source.java'}
},
name: 'meta.embedded.line.java'
},
javaProperties: {
begin: '\\$\\{',
beginCaptures: {0: {name: 'punctuation.section.embedded.begin.ant'}},
contentName: 'source.java-props',
end: '(\\})',
endCaptures: {
0: {name: 'punctuation.section.embedded.end.ant'},
1: {name: 'source.java-props'}
},
name: 'meta.embedded.line.java-props'
},
singlequotedString: {
begin: "'",
beginCaptures: {0: {name: 'punctuation.definition.string.begin.xml.ant'}},
end: "'",
endCaptures: {0: {name: 'punctuation.definition.string.end.xml.ant'}},
name: 'string.quoted.single.xml.ant',
patterns: [{include: '#javaAttributes'}, {include: '#javaProperties'}]
},
tagStuff: {
patterns: [
{
captures: {
1: {name: 'entity.other.attribute-name.namespace.xml.ant'},
2: {name: 'entity.other.attribute-name.xml.ant'},
3: {name: 'punctuation.separator.namespace.xml.ant'},
4: {name: 'entity.other.attribute-name.localname.xml.ant'}
},
match: ' (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)='
},
{include: '#doublequotedString'},
{include: '#singlequotedString'}
]
}
},
scopeName: 'text.xml.ant'
}
export default grammar