annotate runtime/syntax/autodoc.vim @ 18486:9d887cad7315

Added tag v8.1.2237 for changeset 63ee3c2b140fe1b4801389872a8e47aec19d028b
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Oct 2019 20:00:04 +0100
parents 371ceeebbdaa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13125
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim syntax file
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " Language: Autodoc
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Maintainer: Stephen R. van den Berg <srb@cuci.nl>
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Last Change: 2018 Jan 23
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 " Version: 2.9
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " Remark: Included by pike.vim, cmod.vim and optionally c.vim
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " Remark: In order to make c.vim use it, set: c_autodoc
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 " Quit when a (custom) syntax file was already loaded
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 if exists("b:current_syntax")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 finish
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 let s:cpo_save = &cpo
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 set cpo&vim
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 syn case match
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 " A bunch of useful autodoc keywords
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 syn keyword autodocStatement contained appears belongs global
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 syn keyword autodocStatement contained decl directive inherit
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 syn keyword autodocStatement contained deprecated obsolete bugs
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 syn keyword autodocStatement contained copyright example fixme note param returns
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 syn keyword autodocStatement contained seealso thanks throws constant
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 syn keyword autodocStatement contained member index elem
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 syn keyword autodocStatement contained value type item
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 syn keyword autodocRegion contained enum mapping code multiset array
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 syn keyword autodocRegion contained int string section mixed ol ul dl
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 syn keyword autodocRegion contained class module namespace
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 syn keyword autodocRegion contained endenum endmapping endcode endmultiset
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 syn keyword autodocRegion contained endarray endint endstring endsection
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 syn keyword autodocRegion contained endmixed endol endul enddl
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 syn keyword autodocRegion contained endclass endmodule endnamespace
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 syn keyword autodocIgnore contained ignore endignore
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 syn keyword autodocStatAcc contained b i u tt url pre sub sup
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 syn keyword autodocStatAcc contained ref rfc xml dl expr image
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 syn keyword autodocTodo contained TODO FIXME XXX
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 syn match autodocLineStart display "\(//\|/\?\*\)\@2<=!"
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 syn match autodocWords "[^!@{}[\]]\+" display contains=@Spell
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 syn match autodocLink "@\[[^[\]]\+]"hs=s+2,he=e-1 display contains=autodocLead
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 syn match autodocAtStmt "@[a-z]\+\%(\s\|$\)\@="hs=s+1 display contains=autodocStatement,autodocIgnore,autodocLead,autodocRegion
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 " Due to limitations of the matching algorithm, we cannot highlight
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 " nested autodocNStmtAcc structures correctly
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 syn region autodocNStmtAcc start="@[a-z]\+{" end="@}" contains=autodocStatAcc,autodocLead keepend
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 syn match autodocUrl contained display ".\+"
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 syn region autodocAtUrlAcc start="{"ms=s+1 end="@}"he=e-1,me=e-2 contained display contains=autodocUrl,autodocLead keepend
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 syn region autodocNUrlAcc start="@url{" end="@}" contains=autodocStatAcc,autodocAtUrlAcc,autodocLead transparent
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 syn match autodocSpecial "@@" display
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 syn match autodocLead "@" display contained
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 "when wanted, highlight trailing white space
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 if exists("c_space_errors")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 if !exists("c_no_trail_space_error")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 syn match autodocSpaceError display excludenl "\s\+$"
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 if !exists("c_no_tab_space_error")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 syn match autodocSpaceError display " \+\t"me=e-1
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 if exists("c_minlines")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 let b:c_minlines = c_minlines
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 else
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 if !exists("c_no_if0")
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 let b:c_minlines = 50 " #if 0 constructs can be long
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 else
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 let b:c_minlines = 15 " mostly for () constructs
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 endif
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 exec "syn sync ccomment autodocComment minlines=" . b:c_minlines
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 " Define the default highlighting.
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 " Only used when an item doesn't have highlighting yet
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 hi def link autodocStatement Statement
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 hi def link autodocStatAcc Statement
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 hi def link autodocRegion Structure
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 hi def link autodocAtStmt Error
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 hi def link autodocNStmtAcc Identifier
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 hi def link autodocLink Type
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 hi def link autodocTodo Todo
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 hi def link autodocSpaceError Error
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 hi def link autodocLineStart SpecialComment
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 hi def link autodocSpecial SpecialChar
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 hi def link autodocUrl Underlined
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 hi def link autodocLead Statement
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 hi def link autodocIgnore Delimiter
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 let b:current_syntax = "autodoc"
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99 let &cpo = s:cpo_save
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100 unlet s:cpo_save
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 " vim: ts=8