-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdtd.lang
139 lines (120 loc) · 4.52 KB
/
dtd.lang
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of GtkSourceView
Author: Yevgen Muntyan <muntyan@tamu.edu>
Copyright (C) 2006-2007 Yevgen Muntyan <muntyan@tamu.edu>
GtkSourceView is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
GtkSourceView is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, see <http://www.gnu.org/licenses/>.
-->
<language id="dtd" name="DTD" version="2.0" _section="Markup">
<metadata>
<property name="mimetypes">text/x-dtd</property>
<property name="globs">*.dtd</property>
<property name="block-comment-start"><!--</property>
<property name="block-comment-end">--></property>
</metadata>
<styles>
<style id="entity" name="entity" map-to="xml:entity"/>
<style id="decl" name="decl" map-to="xml:doctype"/>
<style id="error" name="error" map-to="xml:error"/>
<style id="quoted-value" name="Quoted Value" map-to="xml:attribute-value"/>
</styles>
<definitions>
<define-regex id="prefix">[a-zA-Z_][a-zA-Z0-9._-]*</define-regex>
<define-regex id="name">[a-zA-Z_][a-zA-Z0-9.:_-]*</define-regex>
<context id="entity" style-ref="entity">
<match>%\%{name};</match>
</context>
<context id="decl-element">
<start><!ELEMENT\b</start>
<end>></end>
<include>
<context sub-pattern="0" where="start" style-ref="decl"/>
<context sub-pattern="0" where="end" style-ref="decl"/>
<context ref="entity"/>
<context ref="quoted-value"/>
</include>
</context>
<context id="quoted-value" style-ref="quoted-value">
<start>"</start>
<end>"</end>
<include>
<context style-ref="entity">
<match>[%&]\%{name};</match>
</context>
<context style-ref="error" extend-parent="false">
<match>[%&]\S*</match>
</context>
</include>
</context>
<context id="NDATA" extend-parent="false">
<start>\bNDATA\b</start>
<include>
<context sub-pattern="0" where="start" style-ref="decl"/>
<context>
<match>\%{name}</match>
</context>
<context ref="error"/>
</include>
</context>
<context id="decl-entity">
<start><!ENTITY\s+(%\s+)?\%{name}\b</start>
<end>></end>
<include>
<context sub-pattern="0" where="start" style-ref="decl"/>
<context sub-pattern="0" where="end" style-ref="decl"/>
<context ref="quoted-value"/>
<context extend-parent="false">
<start>(SYSTEM|PUBLIC)(?=\s|$)</start>
<include>
<context sub-pattern="0" where="start" style-ref="decl"/>
<context ref="quoted-value"/>
<context ref="NDATA"/>
<context ref="error"/>
</include>
</context>
<context ref="error"/>
</include>
</context>
<context id="decl-attlist">
<start><!ATTLIST\b</start>
<end>></end>
<include>
<context sub-pattern="0" where="start" style-ref="decl"/>
<context sub-pattern="0" where="end" style-ref="decl"/>
<context ref="entity"/>
<context ref="quoted-value"/>
</include>
</context>
<context id="decl-notation">
<start><!NOTATION\b</start>
<end>></end>
<include>
<context sub-pattern="0" where="start" style-ref="decl"/>
<context sub-pattern="0" where="end" style-ref="decl"/>
<context ref="entity"/>
<context ref="quoted-value"/>
</include>
</context>
<context id="error" style-ref="error" extend-parent="false">
<match>\S+</match>
</context>
<context id="dtd">
<include>
<context ref="xml:comment"/>
<context ref="decl-element"/>
<context ref="decl-entity"/>
<context ref="decl-attlist"/>
<context ref="decl-notation"/>
</include>
</context>
</definitions>
</language>