Mercurial > vim
annotate runtime/syntax/icon.vim @ 14517:a28fb81c9ecf v8.1.0272
patch 8.1.0272: options test fails if temp var ends in slash
commit https://github.com/vim/vim/commit/f53c692240851f71b930e80a0b0b5d4cfcc1b4a3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 11 17:53:04 2018 +0200
patch 8.1.0272: options test fails if temp var ends in slash
Problem: Options test fails if temp var ends in slash. (Tom Briden)
Solution: Check for optional slash. (closes https://github.com/vim/vim/issues/3308)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Aug 2018 18:00:06 +0200 |
parents | 46763b01cd9a |
children | 1e9e9d89f0ee |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Icon | |
3 " Maintainer: Wendell Turner <wendell@adsi-m4.com> | |
4 " URL: ftp://ftp.halcyon.com/pub/users/wturner/icon.vim | |
5 " Last Change: 2003 May 11 | |
6 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
7 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
8 if exists("b:current_syntax") |
7 | 9 finish |
10 endif | |
11 | |
12 syn keyword iconFunction abs acos any args asin atan bal | |
13 syn keyword iconFunction callout center char chdir close collect copy | |
14 syn keyword iconFunction cos cset delay delete detab display dtor | |
15 syn keyword iconFunction entab errorclear exit exp find flush function | |
16 syn keyword iconFunction get getch getche getenv iand icom image | |
17 syn keyword iconFunction insert integer ior ishift ixor kbhit key | |
18 syn keyword iconFunction left list loadfunc log many map match | |
19 syn keyword iconFunction member move name numeric open ord pop | |
20 syn keyword iconFunction pos proc pull push put read reads | |
21 syn keyword iconFunction real remove rename repl reverse right rtod | |
22 syn keyword iconFunction runerr save seek seq set sin sort | |
23 syn keyword iconFunction sortf sqrt stop string system tab table | |
24 syn keyword iconFunction tan trim type upto variable where write writes | |
25 | |
26 " Keywords | |
27 syn match iconKeyword "&allocated" | |
28 syn match iconKeyword "&ascii" | |
29 syn match iconKeyword "&clock" | |
30 syn match iconKeyword "&collections" | |
31 syn match iconKeyword "&cset" | |
32 syn match iconKeyword "¤t" | |
33 syn match iconKeyword "&date" | |
34 syn match iconKeyword "&dateline" | |
35 syn match iconKeyword "&digits" | |
36 syn match iconKeyword "&dump" | |
37 syn match iconKeyword "&e" | |
38 syn match iconKeyword "&error" | |
39 syn match iconKeyword "&errornumber" | |
40 syn match iconKeyword "&errortext" | |
41 syn match iconKeyword "&errorvalue" | |
42 syn match iconKeyword "&errout" | |
43 syn match iconKeyword "&fail" | |
44 syn match iconKeyword "&features" | |
45 syn match iconKeyword "&file" | |
46 syn match iconKeyword "&host" | |
47 syn match iconKeyword "&input" | |
48 syn match iconKeyword "&lcase" | |
49 syn match iconKeyword "&letters" | |
50 syn match iconKeyword "&level" | |
51 syn match iconKeyword "&line" | |
52 syn match iconKeyword "&main" | |
53 syn match iconKeyword "&null" | |
54 syn match iconKeyword "&output" | |
55 syn match iconKeyword "&phi" | |
56 syn match iconKeyword "&pi" | |
57 syn match iconKeyword "&pos" | |
58 syn match iconKeyword "&progname" | |
59 syn match iconKeyword "&random" | |
60 syn match iconKeyword "®ions" | |
61 syn match iconKeyword "&source" | |
62 syn match iconKeyword "&storage" | |
63 syn match iconKeyword "&subject" | |
64 syn match iconKeyword "&time" | |
65 syn match iconKeyword "&trace" | |
66 syn match iconKeyword "&ucase" | |
67 syn match iconKeyword "&version" | |
68 | |
69 " Reserved words | |
70 syn keyword iconReserved break by case create default do | |
71 syn keyword iconReserved else end every fail if | |
72 syn keyword iconReserved initial link next not of | |
73 syn keyword iconReserved procedure repeat return suspend | |
74 syn keyword iconReserved then to until while | |
75 | |
76 " Storage class reserved words | |
77 syn keyword iconStorageClass global static local record | |
78 | |
79 syn keyword iconTodo contained TODO FIXME XXX BUG | |
80 | |
81 " String and Character constants | |
82 " Highlight special characters (those which have a backslash) differently | |
83 syn match iconSpecial contained "\\x\x\{2}\|\\\o\{3\}\|\\[bdeflnrtv\"\'\\]\|\\^c[a-zA-Z0-9]\|\\$" | |
84 syn region iconString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=iconSpecial | |
85 syn region iconCset start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=iconSpecial | |
86 syn match iconCharacter "'[^\\]'" | |
87 | |
88 " not sure about these | |
89 "syn match iconSpecialCharacter "'\\[bdeflnrtv]'" | |
90 "syn match iconSpecialCharacter "'\\\o\{3\}'" | |
91 "syn match iconSpecialCharacter "'\\x\x\{2}'" | |
92 "syn match iconSpecialCharacter "'\\^c\[a-zA-Z0-9]'" | |
93 | |
94 "when wanted, highlight trailing white space | |
95 if exists("icon_space_errors") | |
96 syn match iconSpaceError "\s*$" | |
97 syn match iconSpaceError " \+\t"me=e-1 | |
98 endif | |
99 | |
100 "catch errors caused by wrong parenthesis | |
101 syn cluster iconParenGroup contains=iconParenError,iconIncluded,iconSpecial,iconTodo,iconUserCont,iconUserLabel,iconBitField | |
102 | |
103 syn region iconParen transparent start='(' end=')' contains=ALLBUT,@iconParenGroup | |
104 syn match iconParenError ")" | |
105 syn match iconInParen contained "[{}]" | |
106 | |
107 | |
108 syn case ignore | |
109 | |
110 "integer number, or floating point number without a dot | |
111 syn match iconNumber "\<\d\+\>" | |
112 | |
113 "floating point number, with dot, optional exponent | |
114 syn match iconFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\>" | |
115 | |
116 "floating point number, starting with a dot, optional exponent | |
117 syn match iconFloat "\.\d\+\(e[-+]\=\d\+\)\=\>" | |
118 | |
119 "floating point number, without dot, with exponent | |
120 syn match iconFloat "\<\d\+e[-+]\=\d\+\>" | |
121 | |
122 "radix number | |
123 syn match iconRadix "\<\d\{1,2}[rR][a-zA-Z0-9]\+\>" | |
124 | |
125 | |
126 " syn match iconIdentifier "\<[a-z_][a-z0-9_]*\>" | |
127 | |
128 syn case match | |
129 | |
130 " Comment | |
131 syn match iconComment "#.*" contains=iconTodo,iconSpaceError | |
132 | |
133 syn region iconPreCondit start="^\s*$\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=iconComment,iconString,iconCharacter,iconNumber,iconCommentError,iconSpaceError | |
134 | |
135 syn region iconIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+ | |
136 syn match iconIncluded contained "<[^>]*>" | |
137 syn match iconInclude "^\s*$\s*include\>\s*["<]" contains=iconIncluded | |
138 "syn match iconLineSkip "\\$" | |
139 | |
140 syn cluster iconPreProcGroup contains=iconPreCondit,iconIncluded,iconInclude,iconDefine,iconInParen,iconUserLabel | |
141 | |
142 syn region iconDefine start="^\s*$\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,@iconPreProcGroup | |
143 | |
144 "wt:syn region iconPreProc "start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" "end="$" contains=ALLBUT,@iconPreProcGroup | |
145 | |
146 " Highlight User Labels | |
147 | |
148 " syn cluster iconMultiGroup contains=iconIncluded,iconSpecial,iconTodo,iconUserCont,iconUserLabel,iconBitField | |
149 | |
150 if !exists("icon_minlines") | |
151 let icon_minlines = 15 | |
152 endif | |
153 exec "syn sync ccomment iconComment minlines=" . icon_minlines | |
154 | |
155 " Define the default highlighting. | |
156 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
157 " Only when an item doesn't have highlighting |
7 | 158 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
159 " The default methods for highlighting. Can be overridden later |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
160 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
161 " hi def link iconSpecialCharacter iconSpecial |
7 | 162 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
163 hi def link iconOctalError iconError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
164 hi def link iconParenError iconError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
165 hi def link iconInParen iconError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
166 hi def link iconCommentError iconError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
167 hi def link iconSpaceError iconError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
168 hi def link iconCommentError iconError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
169 hi def link iconIncluded iconString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
170 hi def link iconCommentString iconString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
171 hi def link iconComment2String iconString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
172 hi def link iconCommentSkip iconComment |
7 | 173 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
174 hi def link iconUserLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
175 hi def link iconCharacter Character |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
176 hi def link iconNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
177 hi def link iconRadix Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
178 hi def link iconFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
179 hi def link iconInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
180 hi def link iconPreProc PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
181 hi def link iconDefine Macro |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
182 hi def link iconError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
183 hi def link iconStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
184 hi def link iconPreCondit PreCondit |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
185 hi def link iconString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
186 hi def link iconCset String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
187 hi def link iconComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
188 hi def link iconSpecial SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
189 hi def link iconTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
190 hi def link iconStorageClass StorageClass |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
191 hi def link iconFunction Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
192 hi def link iconReserved Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
193 hi def link iconKeyword Operator |
7 | 194 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
195 "hi def link iconIdentifier Identifier |
7 | 196 |
197 | |
198 let b:current_syntax = "icon" | |
199 |