Mercurial > vim
annotate runtime/syntax/icon.vim @ 34590:4cad34137ea0
runtime(vim): Update base-syntax, disallow '.' at start of menu item names (#14232)
Commit: https://github.com/vim/vim/commit/ec21bafc135a1e78d40e4fc9118e022bbab958e8
Author: dkearns <dougkearns@gmail.com>
Date: Wed Mar 20 04:04:42 2024 +1100
runtime(vim): Update base-syntax, disallow '.' at start of menu item names (https://github.com/vim/vim/issues/14232)
Disallow '.' at the start of a menu item name.
This is the menu path separator character and should be escaped with a
'\' in this case.
Partially fixes #14230. "popup" is still incorrectly matched as the Ex
command.
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Mar 2024 18:15:05 +0100 |
parents | 1e9e9d89f0ee |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
29193 | 2 " Language: Icon |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainer: Wendell Turner <wendell@adsi-m4.com> (invalid last known address) | |
5 " Last Change: 2022 Jun 16 | |
6 " Contributor: eschen@alumni.princeton.edu 2002.09.18 | |
7 | 7 |
29193 | 8 " Prelude {{{1 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
9 if exists("b:current_syntax") |
7 | 10 finish |
11 endif | |
12 | |
29193 | 13 syn iskeyword @,48-57,_,192-255,& |
14 | |
15 " Not Top {{{1 | |
16 syn cluster iconNotTop contains=iconDocField,iconIncluded,iconStringSpecial,iconTodo,@Spell | |
17 | |
18 " Whitespace errors {{{1 | |
19 if exists("icon_space_errors") | |
20 if !exists("icon_no_trail_space_error") | |
21 syn match iconSpaceError "\s\+$" display excludenl | |
22 endif | |
23 if !exists("icon_no_tab_space_error") | |
24 syn match iconSpaceError " \+\t"me=e-1 display | |
25 endif | |
26 endif | |
7 | 27 |
29193 | 28 " Reserved words {{{1 |
29 syn keyword iconReserved break by case create default do else every fail if | |
30 syn keyword iconReserved initial next not of repeat return suspend then to | |
31 syn keyword iconReserved until while | |
32 | |
33 syn keyword iconStorageClass global static local record invocable | |
7 | 34 |
29193 | 35 syn keyword iconLink link |
7 | 36 |
29193 | 37 " Procedure definitions {{{1 |
38 if exists("icon_no_procedure_fold") | |
39 syn region iconProcedure matchgroup=iconReserved start="\<procedure\>" end="\<end\>" contains=ALLBUT,@iconNotTop | |
40 else | |
41 syn region iconProcedure matchgroup=iconReserved start="\<procedure\>" end="\<end\>" contains=ALLBUT,@iconNotTop fold | |
7 | 42 endif |
43 | |
29193 | 44 " Keywords {{{1 |
45 syn keyword iconKeyword &allocated &ascii &clock &collections &cset ¤t | |
46 syn keyword iconKeyword &date &dateline &digits &dump &e &error &errornumber | |
47 syn keyword iconKeyword &errortext &errorvalue &errout &fail &features &file | |
48 syn keyword iconKeyword &host &input &lcase &letters &level &line &main &null | |
49 syn keyword iconKeyword &output &phi &pi &pos &progname &random ®ions | |
50 syn keyword iconKeyword &source &storage &subject &time &trace &ucase &version | |
51 | |
52 " Graphics keywords | |
53 syn keyword iconKeyword &col &control &interval &ldrag &lpress &lrelease | |
54 syn keyword iconKeyword &mdrag &meta &mpress &mrelease &rdrag &resize &row | |
55 syn keyword iconKeyword &rpress &rrelease &shift &window &x &y | |
56 | |
57 " Functions {{{1 | |
58 syn keyword iconFunction abs acos any args asin atan bal callout center char | |
59 syn keyword iconFunction chdir close collect copy cos cset delay delete detab | |
60 syn keyword iconFunction display dtor entab errorclear exit exp find flush | |
61 syn keyword iconFunction function get getch getche getenv iand icom image | |
62 syn keyword iconFunction insert integer ior ishift ixor kbhit key left list | |
63 syn keyword iconFunction loadfunc log many map match member move name numeric | |
64 syn keyword iconFunction open ord pop pos proc pull push put read reads real | |
65 syn keyword iconFunction remove rename repl reverse right rtod runerr save | |
66 syn keyword iconFunction seek self seq serial set sin sort sortf sqrt stop | |
67 syn keyword iconFunction string system tab table tan trim type upto variable | |
68 syn keyword iconFunction where write writes | |
7 | 69 |
29193 | 70 " Graphics functions |
71 syn keyword iconFunction Active Alert Bg CenterString Clip Clone Color | |
72 syn keyword iconFunction ColorDialog ColorValue CopyArea Couple DrawArc | |
73 syn keyword iconFunction DrawCircle DrawCurve DrawImage DrawLine DrawPoint | |
74 syn keyword iconFunction DrawPolygon DrawRectangle DrawSegment DrawString | |
75 syn keyword iconFunction Enqueue EraseArea Event Fg FillArc FillCircle | |
76 syn keyword iconFunction FillPolygon FillRectangle Font FreeColor GotoRC | |
77 syn keyword iconFunction GotoXY LeftString Lower NewColor Notice OpenDialog | |
78 syn keyword iconFunction PaletteChars PaletteColor PaletteGrays PaletteKey | |
79 syn keyword iconFunction Pattern Pending Pixel Raise ReadImage RightString | |
80 syn keyword iconFunction SaveDialog SelectDialog Shade TextDialog TextWidth | |
81 syn keyword iconFunction ToggleDialog Uncouple WAttrib WClose WDefault WDelay | |
82 syn keyword iconFunction WDone WFlush WOpen WQuit WRead WReads WriteImage | |
83 syn keyword iconFunction WSync WWrite WWrites | |
84 | |
85 " String and character constants {{{1 | |
86 syn match iconStringSpecial "\\x\x\{2}\|\\\o\{3\}\|\\[bdeflnrtv\"\'\\]\|\\^[a-zA-Z0-9]" contained | |
87 syn match iconStringSpecial "\\$" contained | |
88 syn match iconStringSpecial "_\ze\s*$" contained | |
7 | 89 |
29193 | 90 syn region iconString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=iconStringSpecial |
91 syn region iconCset start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=iconStringSpecial | |
7 | 92 |
29193 | 93 " Bracket errors {{{1 |
94 | |
95 if !exists("icon_no_bracket_errors") | |
96 " catch errors caused by wrong brackets (ACE 2002.09.18) | |
97 syn cluster iconBracketGroup contains=iconBracketError,iconIncluded | |
98 syn region iconBracket start='\[' end='\]' contains=ALLBUT,@iconBracketGroup,@iconNotTop transparent | |
99 syn match iconBracketError "]" | |
100 | |
101 "catch errors caused by wrong braces (ACE 2002.09.18) | |
102 syn cluster iconBraceGroup contains=iconBraceError,iconIncluded | |
103 syn region iconBrace start='{' end='}' contains=ALLBUT,@iconBraceGroup,@iconNotTop transparent | |
104 syn match iconBraceError "}" | |
105 | |
106 "catch errors caused by wrong parenthesis | |
107 syn cluster iconParenGroup contains=iconParenError,iconIncluded | |
108 syn region iconParen start='(' end=')' contains=ALLBUT,@iconParenGroup,@iconNotTop transparent | |
109 syn match iconParenError ")" | |
110 end | |
111 | |
112 " Numbers {{{1 | |
7 | 113 syn case ignore |
114 | |
29193 | 115 " integer |
116 syn match iconInteger "\<\d\+\>" | |
117 syn match iconInteger "\<\d\{1,2}[rR][a-zA-Z0-9]\+\>" | |
7 | 118 |
29193 | 119 " real with trailing dot |
120 syn match iconReal "\<\d\+\." | |
7 | 121 |
29193 | 122 " real, with dot, optional exponent |
123 syn match iconReal "\<\d\+\.\d*\%(e[-+]\=\d\+\)\=\>" | |
7 | 124 |
29193 | 125 " real, with leading dot, optional exponent |
126 syn match iconReal "\.\d\+\%(e[-+]\=\d\+\)\=\>" | |
7 | 127 |
29193 | 128 " real, without dot, with exponent |
129 syn match iconReal "\<\d\+e[-+]\=\d\+\>" | |
7 | 130 |
29193 | 131 syn cluster iconNumber contains=iconInteger,iconReal |
7 | 132 |
133 syn case match | |
134 | |
29193 | 135 " Comments {{{1 |
136 syn keyword iconTodo TODO FIXME XXX BUG contained | |
137 syn match iconComment "#.*" contains=iconTodo,iconSpaceError,@Spell | |
138 syn match iconDocField "^#\s\+\zs\%(File\|Subject\|Authors\=\|Date\|Version\|Links\|Requires\|See also\):" contained | |
7 | 139 |
29193 | 140 if exists("icon_no_comment_fold") |
141 syn region iconDocumentation start="\%^#\{2,}\%(\n#\+\%(\s\+.*\)\=\)\+" end="^#\+\n\s*$" contains=iconDocField keepend | |
142 else | |
143 syn region iconMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=iconComment keepend fold transparent | |
144 syn region iconDocumentation start="\%^#\{2,}\%(\n#\)\+" end="^#\+\n\%([^#]\|$\)" contains=iconDocField keepend fold | |
145 endif | |
146 | |
147 " Preprocessor {{{1 | |
148 syn match iconPreInclude '^\s*\zs$\s*include\>\ze\s*"' nextgroup=iconIncluded skipwhite | |
149 syn match iconIncluded '"[^"]\+"' contained | |
7 | 150 |
29193 | 151 syn region iconPreDefine start="^\s*\zs$\s*\%(define\|undef\)\>" end="$" oneline contains=ALLBUT,@iconPreGroup |
152 syn region iconPreProc start="^\s*\zs$\s*\%(error\|line\)\>" end="$" oneline contains=ALLBUT,@iconPreGroup | |
153 syn region iconPreConditional start="^\s*\zs$\s*\%(if\|ifdef\|ifndef\|elif\|else\|endif\)\>" end="$" oneline contains=iconComment,iconString,iconCset,iconNumber,iconSpaceError | |
7 | 154 |
29193 | 155 syn cluster iconPreGroup contains=iconPreCondit,iconPreInclude,iconIncluded,iconPreDefine |
7 | 156 |
29193 | 157 syn match iconPreSymbol "_V\d\+" |
158 syn keyword iconPreSymbol _ACORN _AMIGA _ARM_FUNCTIONS _ASCII _CALLING | |
159 syn keyword iconPreSymbol _CO_EXPRESSIONS _COMPILED _DIRECT_EXECUTION | |
160 syn keyword iconPreSymbol _DOS_FUNCTIONS _EBCDIC _EVENT_MONITOR | |
161 syn keyword iconPreSymbol _EXECUTABLE_IMAGES _EXTERNAL_FUNCTIONS | |
162 syn keyword iconPreSymbol _EXTERNAL_VALUES _INTERPRETED _KEYBOARD_FUNCTIONS | |
163 syn keyword iconPreSymbol _LARGE_INTEGERS _MACINTOSH _MEMORY_MONITOR _MSDOS | |
164 syn keyword iconPreSymbol _MSDOS_386 _MULTIREGION _MULTITASKING _OS2 _PIPES | |
165 syn keyword iconPreSymbol _PORT _PRESENTATION_MGR _RECORD_IO _STRING_INVOKE | |
166 syn keyword iconPreSymbol _SYSTEM_FUNCTION _UNIX _VISUALIZATION _VMS | |
167 syn keyword iconPreSymbol _WINDOW_FUNCTIONS _X_WINDOW_SYSTEM | |
7 | 168 |
29193 | 169 " Syncing {{{1 |
7 | 170 if !exists("icon_minlines") |
29193 | 171 let icon_minlines = 250 |
7 | 172 endif |
173 exec "syn sync ccomment iconComment minlines=" . icon_minlines | |
174 | |
29193 | 175 " Default Highlighting {{{1 |
7 | 176 |
29193 | 177 hi def link iconParenError iconError |
178 hi def link iconBracketError iconError | |
179 hi def link iconBraceError iconError | |
180 hi def link iconSpaceError iconError | |
181 hi def link iconError Error | |
182 | |
183 hi def link iconInteger Number | |
184 hi def link iconReal Float | |
185 hi def link iconString String | |
186 hi def link iconCset String | |
187 hi def link iconStringSpecial SpecialChar | |
7 | 188 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
189 hi def link iconPreProc PreProc |
29193 | 190 hi def link iconIncluded iconString |
191 hi def link iconPreInclude Include | |
192 hi def link iconPreSymbol iconPreProc | |
193 hi def link iconPreDefine Define | |
194 hi def link iconPreConditional PreCondit | |
195 | |
196 hi def link iconStatement Statement | |
197 hi def link iconStorageClass StorageClass | |
198 hi def link iconFunction Function | |
199 hi def link iconReserved Label | |
200 hi def link iconLink Include | |
201 hi def link iconKeyword Keyword | |
202 | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
203 hi def link iconComment Comment |
29193 | 204 hi def link iconTodo Todo |
205 hi def link iconDocField SpecialComment | |
206 hi def link iconDocumentation Comment | |
7 | 207 |
29193 | 208 " Postscript {{{1 |
7 | 209 let b:current_syntax = "icon" |
210 | |
29193 | 211 " vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: |