Mercurial > vim
annotate runtime/syntax/dtd.vim @ 16172:6b0836727cf3 v8.1.1091
patch 8.1.1091: MS-Windows: cannot use multi-byte chars in environment var
commit https://github.com/vim/vim/commit/f0908e6fe18943ad4453d7d6772fa43049aff4bc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 30 20:11:50 2019 +0100
patch 8.1.1091: MS-Windows: cannot use multi-byte chars in environment var
Problem: MS-Windows: cannot use multi-byte chars in environment var.
Solution: Use the wide API. (Ken Takata, closes https://github.com/vim/vim/issues/4008)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 Mar 2019 20:15:05 +0100 |
parents | 46763b01cd9a |
children | 6d11fc4aa683 |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: DTD (Document Type Definition for XML) | |
3 " Maintainer: Johannes Zellner <johannes@zellner.org> | |
4 " Author and previous maintainer: | |
5 " Daniel Amyot <damyot@site.uottawa.ca> | |
6 " Last Change: Tue, 27 Apr 2004 14:54:59 CEST | |
7 " Filenames: *.dtd | |
8 " | |
9 " REFERENCES: | |
10 " http://www.w3.org/TR/html40/ | |
11 " http://www.w3.org/TR/NOTE-html-970421 | |
12 " | |
13 " TODO: | |
14 " - improve synchronizing. | |
15 | |
3526
dd6c2497c997
Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents:
826
diff
changeset
|
16 if exists("b:current_syntax") |
dd6c2497c997
Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents:
826
diff
changeset
|
17 finish |
7 | 18 endif |
3526
dd6c2497c997
Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents:
826
diff
changeset
|
19 let s:dtd_cpo_save = &cpo |
dd6c2497c997
Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents:
826
diff
changeset
|
20 set cpo&vim |
7 | 21 |
22 if !exists("dtd_ignore_case") | |
23 " I prefer having the case takes into consideration. | |
24 syn case match | |
25 else | |
26 syn case ignore | |
27 endif | |
28 | |
29 | |
30 " the following line makes the opening <! and | |
31 " closing > highlighted using 'dtdFunction'. | |
32 " | |
33 " PROVIDES: @dtdTagHook | |
34 " | |
35 syn region dtdTag matchgroup=dtdFunction | |
36 \ start=+<!+ end=+>+ matchgroup=NONE | |
37 \ contains=dtdTag,dtdTagName,dtdError,dtdComment,dtdString,dtdAttrType,dtdAttrDef,dtdEnum,dtdParamEntityInst,dtdParamEntityDecl,dtdCard,@dtdTagHook | |
38 | |
39 if !exists("dtd_no_tag_errors") | |
40 " mark everything as an error which starts with a <! | |
41 " and is not overridden later. If this is annoying, | |
42 " it can be switched off by setting the variable | |
43 " dtd_no_tag_errors. | |
44 syn region dtdError contained start=+<!+lc=2 end=+>+ | |
45 endif | |
46 | |
47 " if this is a html like comment hightlight also | |
48 " the opening <! and the closing > as Comment. | |
826 | 49 syn region dtdComment start=+<![ \t]*--+ end=+-->+ contains=dtdTodo,@Spell |
7 | 50 |
51 | |
52 " proper DTD comment | |
826 | 53 syn region dtdComment contained start=+--+ end=+--+ contains=dtdTodo,@Spell |
7 | 54 |
55 | |
56 " Start tags (keywords). This is contained in dtdFunction. | |
57 " Note that everything not contained here will be marked | |
58 " as error. | |
59 syn match dtdTagName contained +<!\(ATTLIST\|DOCTYPE\|ELEMENT\|ENTITY\|NOTATION\|SHORTREF\|USEMAP\|\[\)+lc=2,hs=s+2 | |
60 | |
61 | |
62 " wildcards and operators | |
63 syn match dtdCard contained "|" | |
64 syn match dtdCard contained "," | |
65 " evenutally overridden by dtdEntity | |
66 syn match dtdCard contained "&" | |
67 syn match dtdCard contained "?" | |
68 syn match dtdCard contained "\*" | |
69 syn match dtdCard contained "+" | |
70 | |
71 " ...and finally, special cases. | |
72 syn match dtdCard "ANY" | |
73 syn match dtdCard "EMPTY" | |
74 | |
75 if !exists("dtd_no_param_entities") | |
76 | |
77 " highlight parameter entity declarations | |
78 " and instances. Note that the closing `;' | |
79 " is optional. | |
80 | |
81 " instances | |
82 syn region dtdParamEntityInst oneline matchgroup=dtdParamEntityPunct | |
83 \ start="%[-_a-zA-Z0-9.]\+"he=s+1,rs=s+1 | |
84 \ skip=+[-_a-zA-Z0-9.]+ | |
85 \ end=";\|\>" | |
86 \ matchgroup=NONE contains=dtdParamEntityPunct | |
87 syn match dtdParamEntityPunct contained "\." | |
88 | |
89 " declarations | |
90 " syn region dtdParamEntityDecl oneline matchgroup=dtdParamEntityDPunct start=+<!ENTITY % +lc=8 skip=+[-_a-zA-Z0-9.]+ matchgroup=NONE end="\>" contains=dtdParamEntityDPunct | |
91 syn match dtdParamEntityDecl +<!ENTITY % [-_a-zA-Z0-9.]*+lc=8 contains=dtdParamEntityDPunct | |
92 syn match dtdParamEntityDPunct contained "%\|\." | |
93 | |
94 endif | |
95 | |
96 " &entities; compare with xml | |
97 syn match dtdEntity "&[^; \t]*;" contains=dtdEntityPunct | |
98 syn match dtdEntityPunct contained "[&.;]" | |
99 | |
100 " Strings are between quotes | |
101 syn region dtdString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard | |
102 syn region dtdString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard | |
103 | |
104 " Enumeration of elements or data between parenthesis | |
105 " | |
106 " PROVIDES: @dtdEnumHook | |
107 " | |
108 syn region dtdEnum matchgroup=dtdType start="(" end=")" matchgroup=NONE contains=dtdEnum,dtdParamEntityInst,dtdCard,@dtdEnumHook | |
109 | |
110 "Attribute types | |
111 syn keyword dtdAttrType NMTOKEN ENTITIES NMTOKENS ID CDATA | |
112 syn keyword dtdAttrType IDREF IDREFS | |
113 " ENTITY has to treated special for not overriding <!ENTITY | |
114 syn match dtdAttrType +[^!]\<ENTITY+ | |
115 | |
116 "Attribute Definitions | |
117 syn match dtdAttrDef "#REQUIRED" | |
118 syn match dtdAttrDef "#IMPLIED" | |
119 syn match dtdAttrDef "#FIXED" | |
120 | |
121 syn case match | |
122 " define some common keywords to mark TODO | |
123 " and important sections inside comments. | |
124 syn keyword dtdTodo contained TODO FIXME XXX | |
125 | |
126 syn sync lines=250 | |
127 | |
128 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3526
diff
changeset
|
129 " Only when an item doesn't have highlighting yet |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3526
diff
changeset
|
130 |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3526
diff
changeset
|
131 " The default highlighting. |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
132 hi def link dtdFunction Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
133 hi def link dtdTag Normal |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
134 hi def link dtdType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
135 hi def link dtdAttrType dtdType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
136 hi def link dtdAttrDef dtdType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
137 hi def link dtdConstant Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
138 hi def link dtdString dtdConstant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
139 hi def link dtdEnum dtdConstant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
140 hi def link dtdCard dtdFunction |
7 | 141 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
142 hi def link dtdEntity Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
143 hi def link dtdEntityPunct dtdType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
144 hi def link dtdParamEntityInst dtdConstant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
145 hi def link dtdParamEntityPunct dtdType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
146 hi def link dtdParamEntityDecl dtdType |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
147 hi def link dtdParamEntityDPunct dtdComment |
7 | 148 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
149 hi def link dtdComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
150 hi def link dtdTagName Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
151 hi def link dtdError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
152 hi def link dtdTodo Todo |
7 | 153 |
154 | |
3526
dd6c2497c997
Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents:
826
diff
changeset
|
155 let &cpo = s:dtd_cpo_save |
dd6c2497c997
Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents:
826
diff
changeset
|
156 unlet s:dtd_cpo_save |
7 | 157 |
158 let b:current_syntax = "dtd" | |
159 | |
160 " vim: ts=8 |