831
|
1 " DoxyGen syntax hilighting extension for c/c++/idl/java
|
|
2 " Language: doxygen on top of c, cpp, idl, java
|
|
3 " Maintainer: Michael Geddes <michaelrgeddes@optushome.com.au>
|
|
4 " Author: Michael Geddes
|
|
5 " Last Change: 12 December 2005
|
|
6 " Version: 1.15
|
|
7 "
|
|
8 " Copyright 2004 Michael Geddes
|
|
9 " Please feel free to use, modify & distribute all or part of this script,
|
|
10 " providing this copyright message remains.
|
|
11 " I would appreciate being acknowledged in any derived scripts, and would
|
|
12 " appreciate and welcome any updates, modifications or suggestions.
|
|
13
|
|
14 " NOTE: Comments welcome!
|
|
15 "
|
|
16 " There are two variables that control the syntax hilighting produced by this
|
|
17 " script:
|
|
18 " doxygen_enhanced_colour - Use the (non-standard) original colours designed for this hilighting.
|
|
19 " doxygen_my_rendering - Disable the HTML bold/italic/underline rendering.
|
|
20 "
|
|
21 " A brief description without '.' or '!' will cause the end comment
|
|
22 " character to be marked as an error. You can define the colour of this using
|
|
23 " the highlight doxygenErrorComment.
|
|
24 " A \link without an \endlink will cause an error hilight on the end-comment.
|
|
25 " This is defined by doxygenLinkError
|
|
26 "
|
|
27 " The variable g:doxygen_codeword_font can be set to the guifont for marking \c
|
|
28 " words - a 'typewriter' like font normally. Spaces must be escaped. It can
|
|
29 " also be set to any hilight attribute. Alternatively, a hilight for doxygenCodeWord
|
|
30 " can be used to override it.
|
|
31 "
|
|
32 " By default, hilighting is done assumng you have the JAVADOC_AUTOBRIEF
|
|
33 " setting tunred on in your Doxygen configuration. If you don't, you
|
|
34 " can set the variable g:doxygen_javadoc_autobrief to 0 to have the
|
|
35 " hilighting more accurately reflect the way Doxygen will interpret your
|
|
36 " comments.
|
|
37 "
|
|
38 " Special thanks to: Wu Yongwei, Toby Allsopp
|
|
39 "
|
|
40
|
|
41 if exists('b:suppress_doxygen')
|
|
42 unlet b:suppress_doxygen
|
|
43 finish
|
|
44 endif
|
|
45
|
|
46 if exists('b:current_syntax') && b:current_syntax =~ 'doxygen' && !exists('doxygen_debug_script')
|
|
47 finish
|
|
48 endif
|
|
49
|
|
50 let s:cpo_save = &cpo
|
835
|
51 try
|
|
52 set cpo&vim
|
831
|
53
|
835
|
54 " Start of Doxygen syntax hilighting:
|
|
55 "
|
831
|
56
|
835
|
57 " C/C++ Style line comments
|
|
58 syn region doxygenComment start=+/\*\(\*/\)\@![*!]+ end=+\*/+ contains=doxygenSyncStart,doxygenStart,doxygenTODO keepend
|
|
59 syn region doxygenCommentL start=+//[/!]<\@!+me=e-1 end=+$+ contains=doxygenStartL keepend skipwhite skipnl nextgroup=doxygenComment2
|
|
60 syn region doxygenCommentL start=+//[/!]<+me=e-2 end=+$+ contains=doxygenStartL keepend skipwhite skipnl
|
|
61 syn region doxygenCommentL start=+//@\ze[{}]+ end=+$+ contains=doxygenGroupDefine,doxygenGroupDefineSpecial
|
831
|
62
|
835
|
63 " Single line brief followed by multiline comment.
|
|
64 syn region doxygenComment2 start=+/\*\(\*/\)\@![*!]+ end=+\*/+ contained contains=doxygenSyncStart2,doxygenStart2,doxygenTODO keepend
|
|
65 " This helps with sync-ing as for some reason, syncing behaves differently to a normal region, and the start pattern does not get matched.
|
|
66 syn match doxygenSyncStart2 +[^*/]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenStartSpecial,doxygenSkipComment,doxygenStartSkip2 skipwhite skipnl
|
|
67
|
|
68 " Skip empty lines at the start for when comments start on the 2nd/3rd line.
|
|
69 syn match doxygenStartSkip2 +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenBody,doxygenStartSpecial,doxygenStartSkip skipwhite skipnl
|
|
70 syn match doxygenStartSkip2 +^\s*\*$+ contained nextgroup=doxygenBody,doxygenStartSpecial,,doxygenStartSkip skipwhite skipnl
|
|
71 syn match doxygenStart2 +/\*[*!]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenStartSpecial,doxygenStartSkip2 skipwhite skipnl
|
831
|
72
|
835
|
73 " Match the Starting pattern (effectively creating the start of a BNF)
|
|
74 if !exists('g:doxygen_javadoc_autobrief') || g:doxygen_javadoc_autobrief
|
|
75 syn match doxygenStart +/\*[*!]+ contained nextgroup=doxygenBrief,doxygenPrev,doxygenFindBriefSpecial,doxygenStartSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl
|
|
76 else
|
|
77 syn match doxygenStart +/\*[*!]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenFindBriefSpecial,doxygenStartSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl
|
|
78 endif
|
|
79 syn match doxygenStartL +//[/!]+ contained nextgroup=doxygenPrevL,doxygenBriefL,doxygenSpecial skipwhite
|
831
|
80
|
835
|
81 " This helps with sync-ing as for some reason, syncing behaves differently to a normal region, and the start pattern does not get matched.
|
|
82 syn match doxygenSyncStart +\ze[^*/]+ contained nextgroup=doxygenBrief,doxygenPrev,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl
|
831
|
83
|
835
|
84 " Match the first sentence as a brief comment
|
|
85 if ! exists('g:doxygen_end_punctuation')
|
|
86 let g:doxygen_end_punctuation='[.]'
|
|
87 endif
|
|
88 exe 'syn region doxygenBrief contained start=+[\\@]\([pcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]+ start=+\(^\s*\)\@<!\*/\@!+ start=+\<\k+ skip=+'.doxygen_end_punctuation.'\S+ end=+'.doxygen_end_punctuation.'+ end=+\(\s*\(\n\s*\*\=\s*\)[@\\]\([pcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\@=+ contains=doxygenSmallSpecial,doxygenContinueComment,doxygenBriefEndComment,doxygenFindBriefSpecial,doxygenSmallSpecial,@doxygenHtmlGroup,doxygenTODO,doxygenOtherLink,doxygenHyperLink,doxygenHashLink skipnl nextgroup=doxygenBody'
|
831
|
89
|
835
|
90 syn match doxygenBriefEndComment +\*/+ contained
|
831
|
91
|
835
|
92 exe 'syn region doxygenBriefL start=+@\k\@!\|[\\@]\([pcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@]+ start=+\<+ skip=+'.doxygen_end_punctuation.'\S+ end=+'.doxygen_end_punctuation.'\|$+ contained contains=doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup keepend'
|
831
|
93
|
835
|
94 syn region doxygenBriefLine contained start=+\<\k+ end=+\(\n\s*\*\=\s*\([@\\]\([pcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\|\s*$\)\@=+ contains=doxygenContinueComment,doxygenFindBriefSpecial,doxygenSmallSpecial,@doxygenHtmlGroup,doxygenTODO,doxygenOtherLink,doxygenHyperLink,doxygenHashLink skipwhite keepend
|
831
|
95
|
835
|
96 " Match a '<' for applying a comment to the previous element.
|
|
97 syn match doxygenPrev +<+ contained nextgroup=doxygenBrief,doxygenSpecial,doxygenStartSkip skipwhite
|
|
98 syn match doxygenPrevL +<+ contained nextgroup=doxygenBriefL,doxygenSpecial skipwhite
|
831
|
99
|
835
|
100 " These are anti-doxygen comments. If there are more than two asterisks or 3 '/'s
|
|
101 " then turn the comments back into normal C comments.
|
|
102 syn region cComment start="/\*\*\*" end="\*/" contains=@cCommentGroup,cCommentString,cCharacter,cNumbersCom,cSpaceError
|
|
103 syn region cCommentL start="////" skip="\\$" end="$" contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError
|
831
|
104
|
835
|
105 " Special commands at the start of the area: starting with '@' or '\'
|
|
106 syn region doxygenStartSpecial contained start=+[@\\]\([pcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=doxygenSpecial nextgroup=doxygenSkipComment skipnl keepend
|
|
107 syn match doxygenSkipComment contained +^\s*\*/\@!+ nextgroup=doxygenBrief,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenPage skipwhite
|
831
|
108
|
835
|
109 "syn region doxygenBodyBit contained start=+$+
|
831
|
110
|
835
|
111 " The main body of a doxygen comment.
|
|
112 syn region doxygenBody contained start=+.\|$+ matchgroup=doxygenEndComment end=+\*/+re=e-2,me=e-2 contains=doxygenContinueComment,doxygenTODO,doxygenSpecial,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup
|
831
|
113
|
835
|
114 " These allow the skipping of comment continuation '*' characters.
|
|
115 syn match doxygenContinueComment contained +^\s*\*/\@!\s*+
|
831
|
116
|
835
|
117 " Catch a Brief comment without punctuation - flag it as an error but
|
|
118 " make sure the end comment is picked up also.
|
|
119 syn match doxygenErrorComment contained +\*/+
|
831
|
120
|
|
121
|
835
|
122 " Skip empty lines at the start for when comments start on the 2nd/3rd line.
|
|
123 if !exists('g:doxygen_javadoc_autobrief') || g:doxygen_javadoc_autobrief
|
|
124 syn match doxygenStartSkip +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenBrief,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl
|
|
125 syn match doxygenStartSkip +^\s*\*$+ contained nextgroup=doxygenBrief,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl
|
|
126 else
|
|
127 syn match doxygenStartSkip +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage,doxygenBody skipwhite skipnl
|
|
128 syn match doxygenStartSkip +^\s*\*$+ contained nextgroup=doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage,doxygenBody skipwhite skipnl
|
|
129 endif
|
831
|
130
|
835
|
131 " Match an [@\]brief so that it moves to body-mode.
|
|
132 "
|
|
133 "
|
|
134 " syn match doxygenBriefLine contained
|
|
135 syn match doxygenBriefSpecial contained +[@\\]+ nextgroup=doxygenBriefWord skipwhite
|
|
136 syn region doxygenFindBriefSpecial start=+[@\\]brief\>+ end=+\(\n\s*\*\=\s*\([@\\]\([pcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\|\s*$\)\@=+ keepend contains=doxygenBriefSpecial nextgroup=doxygenBody keepend skipwhite skipnl contained
|
831
|
137
|
|
138
|
835
|
139 " Create the single word matching special identifiers.
|
831
|
140
|
835
|
141 fun! s:DxyCreateSmallSpecial( kword, name )
|
831
|
142
|
835
|
143 let mx='[-:0-9A-Za-z_%=&+*/!~>|]\@<!\([-0-9A-Za-z_%=+*/!~>|#]\+[-0-9A-Za-z_%=+*/!~>|]\@!\|\\[\\<>&.]@\|[.,][0-9a-zA-Z_]\@=\|::\|([^)]*)\|&[0-9a-zA-Z]\{2,7};\)\+'
|
|
144 exe 'syn region doxygenSpecial'.a:name.'Word contained start=+'.a:kword.'+ end=+\(\_s\+'.mx.'\)\@<=[-a-zA-Z_0-9+*/^%|~!=&\\]\@!+ skipwhite contains=doxygenContinueComment,doxygen'.a:name.'Word'
|
|
145 exe 'syn match doxygen'.a:name.'Word contained "\_s\@<='.mx.'" contains=doxygenHtmlSpecial keepend'
|
|
146 endfun
|
|
147 call s:DxyCreateSmallSpecial('p', 'Code')
|
|
148 call s:DxyCreateSmallSpecial('c', 'Code')
|
|
149 call s:DxyCreateSmallSpecial('b', 'Bold')
|
|
150 call s:DxyCreateSmallSpecial('e', 'Emphasised')
|
|
151 call s:DxyCreateSmallSpecial('em', 'Emphasised')
|
|
152 call s:DxyCreateSmallSpecial('a', 'Argument')
|
|
153 call s:DxyCreateSmallSpecial('ref', 'Ref')
|
|
154 delfun s:DxyCreateSmallSpecial
|
831
|
155
|
835
|
156 syn match doxygenSmallSpecial contained +[@\\]\(\<[pcbea]\>\|\<em\>\|\<ref\>\|\<link\>\|f\$\|[$\\&<>#]\)\@=+ nextgroup=doxygenOtherLink,doxygenHyperLink,doxygenHashLink,doxygenFormula,doxygenSymbol,doxygenSpecial.*Word
|
831
|
157
|
835
|
158 " Now for special characters
|
|
159 syn match doxygenSpecial contained +[@\\]\(\<[pcbea]\>\|\<em\>\|\<ref\|\<link\>\>\|\<f\$\|[$\\&<>#]\)\@!+ nextgroup=doxygenParam,doxygenRetval,doxygenBriefWord,doxygenBold,doxygenBOther,doxygenOther,doxygenOtherTODO,doxygenOtherWARN,doxygenOtherBUG,doxygenPage,doxygenGroupDefine,doxygenCodeRegion,doxygenVerbatimRegion,doxygenDotRegion
|
|
160 " doxygenOtherLink,doxygenSymbol,doxygenFormula,doxygenErrorSpecial,doxygenSpecial.*Word
|
|
161 "
|
|
162 syn match doxygenGroupDefine contained +@\@<=[{}]+
|
|
163 syn match doxygenGroupDefineSpecial contained +@\ze[{}]+
|
831
|
164
|
835
|
165 syn match doxygenErrorSpecial contained +\s+
|
831
|
166
|
835
|
167 " Match Parmaters and retvals (hilighting the first word as special).
|
|
168 syn match doxygenParamDirection contained +\[\(\<in\>\|\<out\>\|,\)\+\]+ nextgroup=doxygenParamName skipwhite
|
|
169 syn keyword doxygenParam contained param nextgroup=doxygenParamName,doxygenParamDirection skipwhite
|
|
170 syn match doxygenParamName contained +[A-Za-z0-9_:]\++ nextgroup=doxygenSpecialMultilineDesc skipwhite
|
|
171 syn keyword doxygenRetval contained retval throw exception nextgroup=doxygenParamName skipwhite
|
831
|
172
|
835
|
173 " Match one line identifiers.
|
|
174 syn keyword doxygenOther contained addindex anchor
|
|
175 \ dontinclude endhtmlonly endlatexonly showinitializer hideinitializer
|
|
176 \ example htmlonly image include ingroup internal latexonly line
|
|
177 \ overload relates relatesalso sa skip skipline
|
|
178 \ until verbinclude version addtogroup htmlinclude copydoc dotfile
|
|
179 \ xmlonly endxmlonly
|
|
180 \ nextgroup=doxygenSpecialOnelineDesc
|
831
|
181
|
835
|
182 syn region doxygenCodeRegion contained matchgroup=doxygenOther start=+\<code\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endcode\>+ contains=doxygenCodeRegionSpecial,doxygenContinueComment,doxygenErrorComment
|
|
183 syn match doxygenCodeRegionSpecial contained +[\\@]\(endcode\>\)\@=+
|
831
|
184
|
835
|
185 syn region doxygenVerbatimRegion contained matchgroup=doxygenOther start=+\<verbatim\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endverbatim\>+ contains=doxygenVerbatimRegionSpecial,doxygenContinueComment,doxygenErrorComment
|
|
186 syn match doxygenVerbatimRegionSpecial contained +[\\@]\(endverbatim\>\)\@=+
|
831
|
187
|
835
|
188 let b:doxygen_syntax_save=b:current_syntax
|
|
189 unlet b:current_syntax
|
|
190 syn include @Dotx syntax/dot.vim
|
|
191 let b:current_syntax=b:doxygen_syntax_save
|
|
192 unlet b:doxygen_syntax_save
|
|
193 syn region doxygenDotRegion contained matchgroup=doxygenOther start=+\<dot\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<enddot\>+ contains=doxygenDotRegionSpecial,doxygenErrorComment,doxygenContinueComment,@Dotx
|
|
194 syn match doxygenDotRegionSpecial contained +[\\@]\(enddot\>\)\@=+
|
831
|
195
|
835
|
196 " Match single line identifiers.
|
|
197 syn keyword doxygenBOther contained class enum file fn mainpage interface
|
|
198 \ namespace struct typedef union var def name
|
|
199 \ nextgroup=doxygenSpecialTypeOnelineDesc
|
831
|
200
|
835
|
201 syn keyword doxygenOther contained par nextgroup=doxygenHeaderLine
|
|
202 syn region doxygenHeaderLine start=+.+ end=+^+ contained skipwhite nextgroup=doxygenSpecialMultilineDesc
|
831
|
203
|
835
|
204 syn keyword doxygenOther contained arg author date deprecated li return see invariant note post pre remarks since test nextgroup=doxygenSpecialMultilineDesc
|
|
205 syn keyword doxygenOtherTODO contained todo attention nextgroup=doxygenSpecialMultilineDesc
|
|
206 syn keyword doxygenOtherWARN contained warning nextgroup=doxygenSpecialMultilineDesc
|
|
207 syn keyword doxygenOtherBUG contained bug nextgroup=doxygenSpecialMultilineDesc
|
831
|
208
|
835
|
209 " Handle \link, \endlink, hilighting the link-to and the link text bits separately.
|
|
210 syn region doxygenOtherLink matchgroup=doxygenOther start=+link+ end=+[\@]\@<=endlink\>+ contained contains=doxygenLinkWord,doxygenContinueComment,doxygenLinkError,doxygenEndlinkSpecial
|
|
211 syn match doxygenEndlinkSpecial contained +[\\@]\zeendlink\>+
|
831
|
212
|
835
|
213 syn match doxygenLinkWord "[_a-zA-Z:#()][_a-z0-9A-Z:#()]*\>" contained skipnl nextgroup=doxygenLinkRest,doxygenContinueLinkComment
|
|
214 syn match doxygenLinkRest +[^*@\\]\|\*/\@!\|[@\\]\(endlink\>\)\@!+ contained skipnl nextgroup=doxygenLinkRest,doxygenContinueLinkComment
|
|
215 syn match doxygenContinueLinkComment contained +^\s*\*\=[^/]+me=e-1 nextgroup=doxygenLinkRest
|
|
216 syn match doxygenLinkError "\*/" contained
|
|
217 " #Link hilighting.
|
|
218 syn match doxygenHashLink /\([a-zA-Z_][0-9a-zA-Z_]*\)\?#\(\.[0-9a-zA-Z_]\@=\|[a-zA-Z0-9_]\+\|::\|()\)\+/ contained contains=doxygenHashSpecial
|
|
219 syn match doxygenHashSpecial /#/ contained
|
|
220 syn match doxygenHyperLink /\(\s\|^\s*\*\?\)\@<=\(http\|https\|ftp\):\/\/[-0-9a-zA-Z_?&=+#%/.!':;@]\+/ contained
|
831
|
221
|
835
|
222 " Handle \page. This does not use doxygenBrief.
|
|
223 syn match doxygenPage "[\\@]page\>"me=s+1 contained skipwhite nextgroup=doxygenPagePage
|
|
224 syn keyword doxygenPagePage page contained skipwhite nextgroup=doxygenPageIdent
|
|
225 syn region doxygenPageDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend skipwhite skipnl nextgroup=doxygenBody
|
|
226 syn match doxygenPageIdent "\<[a-zA-Z0-9]\+\>" contained nextgroup=doxygenPageDesc
|
831
|
227
|
835
|
228 " Handle section
|
|
229 syn keyword doxygenOther defgroup section subsection subsubsection weakgroup contained skipwhite nextgroup=doxygenSpecialIdent
|
|
230 syn region doxygenSpecialSectionDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend skipwhite skipnl nextgroup=doxygenContinueComment
|
|
231 syn match doxygenSpecialIdent "\<[a-zA-Z0-9]\+\>" contained nextgroup=doxygenSpecialSectionDesc
|
831
|
232
|
835
|
233 " Does the one-line description for the one-line type identifiers.
|
|
234 syn region doxygenSpecialTypeOnelineDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend
|
|
235 syn region doxygenSpecialOnelineDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend
|
831
|
236
|
835
|
237 " Handle the multiline description for the multiline type identifiers.
|
|
238 " Continue until an 'empty' line (can contain a '*' continuation) or until the
|
|
239 " next whole-line @ command \ command.
|
|
240 syn region doxygenSpecialMultilineDesc start=+.\++ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([pcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contained contains=doxygenSpecialContinueComment,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup skipwhite keepend
|
|
241 syn match doxygenSpecialContinueComment contained +^\s*\*/\@!\s*+ nextgroup=doxygenSpecial skipwhite
|
831
|
242
|
835
|
243 " Handle special cases 'bold' and 'group'
|
|
244 syn keyword doxygenBold contained bold nextgroup=doxygenSpecialHeading
|
|
245 syn keyword doxygenBriefWord contained brief nextgroup=doxygenBriefLine skipwhite
|
|
246 syn match doxygenSpecialHeading +.\++ contained skipwhite
|
|
247 syn keyword doxygenGroup contained group nextgroup=doxygenGroupName skipwhite
|
|
248 syn keyword doxygenGroupName contained +\k\++ nextgroup=doxygenSpecialOnelineDesc skipwhite
|
831
|
249
|
835
|
250 " Handle special symbol identifiers @$, @\, @$ etc
|
|
251 syn match doxygenSymbol contained +[$\\&<>#]+
|
831
|
252
|
835
|
253 " Simplistic handling of formula regions
|
|
254 syn region doxygenFormula contained matchgroup=doxygenFormulaEnds start=+f\$+ end=+[@\\]f\$+ contains=doxygenFormulaSpecial,doxygenFormulaOperator
|
|
255 syn match doxygenFormulaSpecial contained +[@\\]\(f[^$]\|[^f]\)+me=s+1 nextgroup=doxygenFormulaKeyword,doxygenFormulaEscaped
|
|
256 syn match doxygenFormulaEscaped contained "."
|
|
257 syn match doxygenFormulaKeyword contained "[a-z]\+"
|
|
258 syn match doxygenFormulaOperator contained +[_^]+
|
831
|
259
|
835
|
260 syn region doxygenFormula contained matchgroup=doxygenFormulaEnds start=+f\[+ end=+[@\\]f]+ contains=doxygenFormulaSpecial,doxygenFormulaOperator,doxygenAtom
|
|
261 syn region doxygenAtom contained transparent matchgroup=doxygenFormulaOperator start=+{+ end=+}+ contains=doxygenAtom,doxygenFormulaSpecial,doxygenFormulaOperator
|
831
|
262
|
835
|
263 " Add TODO hilighting.
|
|
264 syn keyword doxygenTODO contained TODO README XXX FIXME
|
831
|
265
|
835
|
266 " Supported HTML subset. Not perfect, but okay.
|
|
267 syn case ignore
|
|
268 syn region doxygenHtmlTag contained matchgroup=doxygenHtmlCh start=+\v\</=\ze([biuap]|em|strong|img|br|center|code|dfn|d[ldt]|hr|h[0-3]|li|[ou]l|pre|small|sub|sup|table|tt|var|caption|src|alt|longdesc|name|height|width|usemap|ismap|href|type)>+ skip=+\\<\|\<\k\+=\("[^"]*"\|'[^']*\)+ end=+>+ contains=doxygenHtmlCmd,doxygenContinueComment,doxygenHtmlVar
|
|
269 syn keyword doxygenHtmlCmd contained b i em strong u img a br p center code dfn dl dd dt hr h1 h2 h3 li ol ul pre small sub sup table tt var caption nextgroup=doxygenHtmlVar skipwhite
|
|
270 syn keyword doxygenHtmlVar contained src alt longdesc name height width usemap ismap href type nextgroup=doxygenHtmlEqu skipwhite
|
|
271 syn match doxygenHtmlEqu contained +=+ nextgroup=doxygenHtmlExpr skipwhite
|
|
272 syn match doxygenHtmlExpr contained +"\(\\.\|[^"]\)*"\|'\(\\.\|[^']\)*'+ nextgroup=doxygenHtmlVar skipwhite
|
|
273 syn case match
|
|
274 syn match doxygenHtmlSpecial contained "&\(copy\|quot\|[AEIOUYaeiouy]uml\|[AEIOUYaeiouy]acute\|[AEIOUaeiouy]grave\|[AEIOUaeiouy]circ\|[ANOano]tilde\|szlig\|[Aa]ring\|nbsp\|gt\|lt\|amp\);"
|
831
|
275
|
835
|
276 syn cluster doxygenHtmlGroup contains=doxygenHtmlCode,doxygenHtmlBold,doxygenHtmlUnderline,doxygenHtmlItalic,doxygenHtmlSpecial,doxygenHtmlTag,doxygenHtmlLink
|
831
|
277
|
835
|
278 syn cluster doxygenHtmlTop contains=@Spell,doxygenHtmlSpecial,doxygenHtmlTag,doxygenContinueComment
|
|
279 " Html Support
|
|
280 syn region doxygenHtmlLink contained start=+<[aA]\>\s*\(\n\s*\*\s*\)\=\(\(name\|href\)=\("[^"]*"\|'[^']*'\)\)\=\s*>+ end=+</[aA]>+me=e-4 contains=@doxygenHtmlTop
|
|
281 hi link doxygenHtmlLink Underlined
|
831
|
282
|
835
|
283 syn region doxygenHtmlBold contained start="\c<b\>" end="\c</b>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlBoldUnderline,doxygenHtmlBoldItalic
|
|
284 syn region doxygenHtmlBold contained start="\c<strong\>" end="\c</strong>"me=e-9 contains=@doxygenHtmlTop,doxygenHtmlBoldUnderline,doxygenHtmlBoldItalic
|
|
285 syn region doxygenHtmlBoldUnderline contained start="\c<u\>" end="\c</u>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlBoldUnderlineItalic
|
|
286 syn region doxygenHtmlBoldItalic contained start="\c<i\>" end="\c</i>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlBoldItalicUnderline
|
|
287 syn region doxygenHtmlBoldItalic contained start="\c<em\>" end="\c</em>"me=e-5 contains=@doxygenHtmlTop,doxygenHtmlBoldItalicUnderline
|
|
288 syn region doxygenHtmlBoldUnderlineItalic contained start="\c<i\>" end="\c</i>"me=e-4 contains=@doxygenHtmlTop
|
|
289 syn region doxygenHtmlBoldUnderlineItalic contained start="\c<em\>" end="\c</em>"me=e-5 contains=@doxygenHtmlTop
|
|
290 syn region doxygenHtmlBoldItalicUnderline contained start="\c<u\>" end="\c</u>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlBoldUnderlineItalic
|
831
|
291
|
835
|
292 syn region doxygenHtmlUnderline contained start="\c<u\>" end="\c</u>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlUnderlineBold,doxygenHtmlUnderlineItalic
|
|
293 syn region doxygenHtmlUnderlineBold contained start="\c<b\>" end="\c</b>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlUnderlineBoldItalic
|
|
294 syn region doxygenHtmlUnderlineBold contained start="\c<strong\>" end="\c</strong>"me=e-9 contains=@doxygenHtmlTop,doxygenHtmlUnderlineBoldItalic
|
|
295 syn region doxygenHtmlUnderlineItalic contained start="\c<i\>" end="\c</i>"me=e-4 contains=@doxygenHtmlTop,htmUnderlineItalicBold
|
|
296 syn region doxygenHtmlUnderlineItalic contained start="\c<em\>" end="\c</em>"me=e-5 contains=@doxygenHtmlTop,htmUnderlineItalicBold
|
|
297 syn region doxygenHtmlUnderlineItalicBold contained start="\c<b\>" end="\c</b>"me=e-4 contains=@doxygenHtmlTop
|
|
298 syn region doxygenHtmlUnderlineItalicBold contained start="\c<strong\>" end="\c</strong>"me=e-9 contains=@doxygenHtmlTop
|
|
299 syn region doxygenHtmlUnderlineBoldItalic contained start="\c<i\>" end="\c</i>"me=e-4 contains=@doxygenHtmlTop
|
|
300 syn region doxygenHtmlUnderlineBoldItalic contained start="\c<em\>" end="\c</em>"me=e-5 contains=@doxygenHtmlTop
|
831
|
301
|
835
|
302 syn region doxygenHtmlItalic contained start="\c<i\>" end="\c</i>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlItalicBold,doxygenHtmlItalicUnderline
|
|
303 syn region doxygenHtmlItalic contained start="\c<em\>" end="\c</em>"me=e-5 contains=@doxygenHtmlTop
|
|
304 syn region doxygenHtmlItalicBold contained start="\c<b\>" end="\c</b>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlItalicBoldUnderline
|
|
305 syn region doxygenHtmlItalicBold contained start="\c<strong\>" end="\c</strong>"me=e-9 contains=@doxygenHtmlTop,doxygenHtmlItalicBoldUnderline
|
|
306 syn region doxygenHtmlItalicBoldUnderline contained start="\c<u\>" end="\c</u>"me=e-4 contains=@doxygenHtmlTop
|
|
307 syn region doxygenHtmlItalicUnderline contained start="\c<u\>" end="\c</u>"me=e-4 contains=@doxygenHtmlTop,doxygenHtmlItalicUnderlineBold
|
|
308 syn region doxygenHtmlItalicUnderlineBold contained start="\c<b\>" end="\c</b>"me=e-4 contains=@doxygenHtmlTop
|
|
309 syn region doxygenHtmlItalicUnderlineBold contained start="\c<strong\>" end="\c</strong>"me=e-9 contains=@doxygenHtmlTop
|
831
|
310
|
835
|
311 syn region doxygenHtmlCode contained start="\c<code\>" end="\c</code>"me=e-7 contains=@doxygenHtmlTop
|
831
|
312
|
835
|
313 " Prevent the doxygen contained matches from leaking into the c groups.
|
|
314 syn cluster cParenGroup add=doxygen.*
|
|
315 syn cluster cParenGroup remove=doxygenComment,doxygenCommentL
|
|
316 syn cluster cPreProcGroup add=doxygen.*
|
|
317 syn cluster cMultiGroup add=doxygen.*
|
|
318 syn cluster rcParenGroup add=doxygen.*
|
|
319 syn cluster rcParenGroup remove=doxygenComment,doxygenCommentL
|
|
320 syn cluster rcGroup add=doxygen.*
|
831
|
321
|
835
|
322 let s:my_syncolor=0
|
|
323 if !exists(':SynColor')
|
|
324 command -nargs=+ SynColor hi def <args>
|
|
325 let s:my_syncolor=1
|
|
326 endif
|
|
327
|
|
328 let s:my_synlink=0
|
|
329 if !exists(':SynLink')
|
|
330 command -nargs=+ SynLink hi def link <args>
|
|
331 let s:my_synlink=1
|
831
|
332 endif
|
|
333
|
835
|
334 try
|
|
335 "let did_doxygen_syntax_inits = &background
|
|
336 hi doxygen_Dummy guifg=black
|
831
|
337
|
835
|
338 fun! s:Doxygen_Hilights_Base()
|
|
339 SynLink doxygenHtmlSpecial Special
|
|
340 SynLink doxygenHtmlVar Type
|
|
341 SynLink doxygenHtmlExpr String
|
831
|
342
|
835
|
343 SynLink doxygenSmallSpecial SpecialChar
|
831
|
344
|
835
|
345 SynLink doxygenSpecialCodeWord doxygenSmallSpecial
|
|
346 SynLink doxygenSpecialBoldWord doxygenSmallSpecial
|
|
347 SynLink doxygenSpecialEmphasisedWord doxygenSmallSpecial
|
|
348 SynLink doxygenSpecialArgumentWord doxygenSmallSpecial
|
831
|
349
|
835
|
350 " SynColor doxygenFormulaKeyword cterm=bold ctermfg=DarkMagenta guifg=DarkMagenta gui=bold
|
|
351 SynLink doxygenFormulaKeyword Keyword
|
|
352 "SynColor doxygenFormulaEscaped ctermfg=DarkMagenta guifg=DarkMagenta gui=bold
|
|
353 SynLink doxygenFormulaEscaped Special
|
|
354 SynLink doxygenFormulaOperator Operator
|
|
355 SynLink doxygenFormula Statement
|
|
356 SynLink doxygenSymbol Constant
|
|
357 SynLink doxygenSpecial Special
|
|
358 SynLink doxygenFormulaSpecial Special
|
|
359 "SynColor doxygenFormulaSpecial ctermfg=DarkBlue guifg=DarkBlue
|
|
360 endfun
|
|
361 call s:Doxygen_Hilights_Base()
|
831
|
362
|
835
|
363 fun! s:Doxygen_Hilights()
|
|
364 " Pick a sensible default for 'codeword'.
|
|
365 let font=''
|
|
366 if exists('g:doxygen_codeword_font')
|
|
367 if g:doxygen_codeword_font !~ '\<\k\+='
|
|
368 let font='font='.g:doxygen_codeword_font
|
|
369 else
|
|
370 let font=g:doxygen_codeword_font
|
|
371 endif
|
831
|
372 else
|
835
|
373 " Try and pick a font (only some platforms have been tested).
|
|
374 if has('gui_running')
|
|
375 if has('gui_gtk2')
|
|
376 if &guifont == ''
|
|
377 let font="font='FreeSerif 12'"
|
|
378 else
|
|
379 let font="font='".substitute(&guifont, '^.\{-}\([0-9]\+\)$', 'FreeSerif \1','')."'"
|
|
380 endif
|
|
381
|
|
382 elseif has('gui_win32') || has('gui_win16') || has('gui_win95')
|
|
383 if &guifont == ''
|
|
384 let font='font=Lucida_Console:h10'
|
|
385 else
|
|
386 let font='font='.substitute(&guifont, '^[^:]*', 'Lucida_Console','')
|
|
387 endif
|
|
388 elseif has('gui_athena') || has('gui_gtk') || &guifont=~'^\(-[^-]\+\)\{14}'
|
|
389 if &guifont == ''
|
|
390 let font='font=-b&h-lucidatypewriter-medium-r-normal-*-*-140-*-*-m-*-iso8859-1'
|
|
391 else
|
|
392 " let font='font='.substitute(&guifont,'^\(-[^-]\+\)\{7}-\([0-9]\+\).*', '-b\&h-lucidatypewriter-medium-r-normal-*-*-\2-*-*-m-*-iso8859-1','')
|
|
393 " The above line works, but it is hard to expect the combination of
|
|
394 " the two fonts will look good.
|
|
395 endif
|
|
396 elseif has('gui_kde')
|
|
397 " let font='font=Bitstream\ Vera\ Sans\ Mono/12/-1/5/50/0/0/0/0/0'
|
831
|
398 endif
|
|
399 endif
|
|
400 endif
|
835
|
401 if font=='' | let font='gui=bold' | endif
|
|
402 exe 'SynColor doxygenCodeWord term=bold cterm=bold '.font
|
|
403 if (exists('g:doxygen_enhanced_color') && g:doxygen_enhanced_color) || (exists('g:doxygen_enhanced_colour') && g:doxygen_enhanced_colour)
|
|
404 if &background=='light'
|
|
405 SynColor doxygenComment ctermfg=DarkRed guifg=DarkRed
|
|
406 SynColor doxygenBrief cterm=bold ctermfg=Cyan guifg=DarkBlue gui=bold
|
|
407 SynColor doxygenBody ctermfg=DarkBlue guifg=DarkBlue
|
|
408 SynColor doxygenSpecialTypeOnelineDesc cterm=bold ctermfg=DarkRed guifg=firebrick3 gui=bold
|
|
409 SynColor doxygenBOther cterm=bold ctermfg=DarkMagenta guifg=#aa50aa gui=bold
|
|
410 SynColor doxygenParam ctermfg=DarkGray guifg=#aa50aa
|
|
411 SynColor doxygenParamName cterm=italic ctermfg=DarkBlue guifg=DeepSkyBlue4 gui=italic,bold
|
|
412 SynColor doxygenSpecialOnelineDesc cterm=bold ctermfg=DarkCyan guifg=DodgerBlue3 gui=bold
|
|
413 SynColor doxygenSpecialHeading cterm=bold ctermfg=DarkBlue guifg=DeepSkyBlue4 gui=bold
|
|
414 SynColor doxygenPrev ctermfg=DarkGreen guifg=DarkGreen
|
|
415 else
|
|
416 SynColor doxygenComment ctermfg=LightRed guifg=LightRed
|
|
417 SynColor doxygenBrief cterm=bold ctermfg=Cyan ctermbg=darkgrey guifg=LightBlue gui=Bold,Italic
|
|
418 SynColor doxygenBody ctermfg=Cyan guifg=LightBlue
|
|
419 SynColor doxygenSpecialTypeOnelineDesc cterm=bold ctermfg=Red guifg=firebrick3 gui=bold
|
|
420 SynColor doxygenBOther cterm=bold ctermfg=Magenta guifg=#aa50aa gui=bold
|
|
421 SynColor doxygenParam ctermfg=LightGray guifg=LightGray
|
|
422 SynColor doxygenParamName cterm=italic ctermfg=LightBlue guifg=LightBlue gui=italic,bold
|
|
423 SynColor doxygenSpecialOnelineDesc cterm=bold ctermfg=LightCyan guifg=LightCyan gui=bold
|
|
424 SynColor doxygenSpecialHeading cterm=bold ctermfg=LightBlue guifg=LightBlue gui=bold
|
|
425 SynColor doxygenPrev ctermfg=LightGreen guifg=LightGreen
|
|
426 endif
|
831
|
427 else
|
835
|
428 SynLink doxygenComment SpecialComment
|
|
429 SynLink doxygenBrief Statement
|
|
430 SynLink doxygenBody Comment
|
|
431 SynLink doxygenSpecialTypeOnelineDesc Statement
|
|
432 SynLink doxygenBOther Constant
|
|
433 SynLink doxygenParam SpecialComment
|
|
434 SynLink doxygenParamName Underlined
|
|
435 SynLink doxygenSpecialOnelineDesc Statement
|
|
436 SynLink doxygenSpecialHeading Statement
|
|
437 SynLink doxygenPrev SpecialComment
|
831
|
438 endif
|
835
|
439 endfun
|
|
440
|
|
441 call s:Doxygen_Hilights()
|
834
|
442
|
835
|
443 " This is still a proposal, but won't do any harm.
|
|
444 aug doxygengroup
|
|
445 au!
|
|
446 au Syntax UserColor_reset nested call s:Doxygen_Hilights_Base()
|
|
447 au Syntax UserColor_{on,reset,enable} nested call s:Doxygen_Hilights()
|
|
448 aug END
|
834
|
449
|
831
|
450
|
835
|
451 SynLink doxygenBody Comment
|
|
452 SynLink doxygenTODO Todo
|
|
453 SynLink doxygenOtherTODO Todo
|
|
454 SynLink doxygenOtherWARN Todo
|
|
455 SynLink doxygenOtherBUG Todo
|
831
|
456
|
835
|
457 SynLink doxygenErrorSpecial Error
|
|
458 SynLink doxygenErrorEnd Error
|
|
459 SynLink doxygenErrorComment Error
|
|
460 SynLink doxygenLinkError Error
|
|
461 SynLink doxygenBriefSpecial doxygenSpecial
|
|
462 SynLink doxygenHashSpecial doxygenSpecial
|
|
463 SynLink doxygenGroupDefineSpecial doxygenSpecial
|
|
464 SynLink doxygenEndlinkSpecial doxygenSpecial
|
|
465 SynLink doxygenCodeRegionSpecial doxygenSpecial
|
|
466 SynLink doxygenVerbatimRegionSpecial doxygenSpecial
|
|
467 SynLink doxygenGroupDefine doxygenParam
|
831
|
468
|
835
|
469 SynLink doxygenSpecialMultilineDesc doxygenSpecialOnelineDesc
|
|
470 SynLink doxygenFormulaEnds doxygenSpecial
|
|
471 SynLink doxygenBold doxygenParam
|
|
472 SynLink doxygenBriefWord doxygenParam
|
|
473 SynLink doxygenRetval doxygenParam
|
|
474 SynLink doxygenOther doxygenParam
|
|
475 SynLink doxygenStart doxygenComment
|
|
476 SynLink doxygenStart2 doxygenStart
|
|
477 SynLink doxygenComment2 doxygenComment
|
|
478 SynLink doxygenCommentL doxygenComment
|
|
479 SynLink doxygenContinueComment doxygenComment
|
|
480 SynLink doxygenSpecialContinueComment doxygenComment
|
|
481 SynLink doxygenSkipComment doxygenComment
|
|
482 SynLink doxygenEndComment doxygenComment
|
|
483 SynLink doxygenStartL doxygenComment
|
|
484 SynLink doxygenBriefEndComment doxygenComment
|
|
485 SynLink doxygenPrevL doxygenPrev
|
|
486 SynLink doxygenBriefL doxygenBrief
|
|
487 SynLink doxygenBriefLine doxygenBrief
|
|
488 SynLink doxygenHeaderLine doxygenSpecialHeading
|
|
489 SynLink doxygenStartSkip doxygenContinueComment
|
|
490 SynLink doxygenLinkWord doxygenParamName
|
|
491 SynLink doxygenLinkRest doxygenSpecialMultilineDesc
|
|
492 SynLink doxygenHyperLink doxygenLinkWord
|
|
493 SynLink doxygenHashLink doxygenLinkWord
|
831
|
494
|
835
|
495 SynLink doxygenPage doxygenSpecial
|
|
496 SynLink doxygenPagePage doxygenBOther
|
|
497 SynLink doxygenPageIdent doxygenParamName
|
|
498 SynLink doxygenPageDesc doxygenSpecialTypeOnelineDesc
|
831
|
499
|
835
|
500 SynLink doxygenSpecialIdent doxygenPageIdent
|
|
501 SynLink doxygenSpecialSectionDesc doxygenSpecialMultilineDesc
|
831
|
502
|
835
|
503 SynLink doxygenSpecialRefWord doxygenOther
|
|
504 SynLink doxygenRefWord doxygenPageIdent
|
|
505 SynLink doxygenContinueLinkComment doxygenComment
|
831
|
506
|
835
|
507 SynLink doxygenHtmlCh Function
|
|
508 SynLink doxygenHtmlCmd Statement
|
|
509 SynLink doxygenHtmlBoldItalicUnderline doxygenHtmlBoldUnderlineItalic
|
|
510 SynLink doxygenHtmlUnderlineBold doxygenHtmlBoldUnderline
|
|
511 SynLink doxygenHtmlUnderlineItalicBold doxygenHtmlBoldUnderlineItalic
|
|
512 SynLink doxygenHtmlUnderlineBoldItalic doxygenHtmlBoldUnderlineItalic
|
|
513 SynLink doxygenHtmlItalicUnderline doxygenHtmlUnderlineItalic
|
|
514 SynLink doxygenHtmlItalicBold doxygenHtmlBoldItalic
|
|
515 SynLink doxygenHtmlItalicBoldUnderline doxygenHtmlBoldUnderlineItalic
|
|
516 SynLink doxygenHtmlItalicUnderlineBold doxygenHtmlBoldUnderlineItalic
|
|
517 SynLink doxygenHtmlLink Underlined
|
831
|
518
|
835
|
519 SynLink doxygenParamDirection StorageClass
|
831
|
520
|
|
521
|
835
|
522 if !exists("doxygen_my_rendering") && !exists("html_my_rendering")
|
|
523 SynColor doxygenBoldWord term=bold cterm=bold gui=bold
|
|
524 SynColor doxygenEmphasisedWord term=italic cterm=italic gui=italic
|
|
525 SynLink doxygenArgumentWord doxygenEmphasisedWord
|
|
526 SynLink doxygenHtmlCode doxygenCodeWord
|
|
527 SynLink doxygenHtmlBold doxygenBoldWord
|
|
528 SynColor doxygenHtmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
|
|
529 SynColor doxygenHtmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
|
|
530 SynColor doxygenHtmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
|
|
531 SynColor doxygenHtmlUnderline term=underline cterm=underline gui=underline
|
|
532 SynColor doxygenHtmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
|
|
533 SynColor doxygenHtmlItalic term=italic cterm=italic gui=italic
|
|
534 endif
|
831
|
535
|
835
|
536 finally
|
|
537 if s:my_synlink | delcommand SynLink | endif
|
|
538 if s:my_syncolor | delcommand SynColor | endif
|
|
539 endtry
|
831
|
540
|
835
|
541 if &syntax=='idl'
|
|
542 syn cluster idlCommentable add=doxygenComment,doxygenCommentL
|
|
543 endif
|
|
544
|
|
545 "syn sync clear
|
|
546 "syn sync maxlines=500
|
|
547 "syn sync minlines=50
|
|
548 syn sync match doxygenComment groupthere cComment "/\@<!/\*"
|
|
549 syn sync match doxygenSyncComment grouphere doxygenComment "/\@<!/\*[*!]"
|
|
550 "syn sync match doxygenSyncComment grouphere doxygenComment "/\*[*!]" contains=doxygenStart,doxygenTODO keepend
|
|
551 syn sync match doxygenSyncEndComment groupthere NONE "\*/"
|
831
|
552
|
835
|
553 if !exists('b:current_syntax')
|
|
554 let b:current_syntax = "doxygen"
|
|
555 else
|
|
556 let b:current_syntax = b:current_syntax.'.doxygen'
|
|
557 endif
|
831
|
558
|
835
|
559 finally
|
|
560 let &cpo = s:cpo_save
|
|
561 unlet s:cpo_save
|
|
562 endtry
|
|
563
|
831
|
564 " vim:et sw=2 sts=2
|