comparison runtime/syntax/pascal.vim @ 24569:e3ec2ec8841a

Update runtime files Commit: https://github.com/vim/vim/commit/4c295027a426986566cd7a76c47a6d3a529727e7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 2 17:19:11 2021 +0200 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sun, 02 May 2021 17:30:05 +0200
parents 5b7ea82bc18f
children bdda48f01a68
comparison
equal deleted inserted replaced
24568:3671ff322103 24569:e3ec2ec8841a
1 " Vim syntax file 1 " Vim syntax file
2 " Language: Pascal 2 " Language: Pascal
3 " Version: 2.8 3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
4 " Last Change: 2004/10/17 17:47:30 4 " Previous Maintainers: Xavier Crégut <xavier.cregut@enseeiht.fr>
5 " Maintainer: Xavier Crégut <xavier.cregut@enseeiht.fr> 5 " Mario Eusebio <bio@dq.fct.unl.pt>
6 " Previous Maintainer: Mario Eusebio <bio@dq.fct.unl.pt> 6 " Last Change: 2021 Apr 23
7 7
8 " Contributors: Tim Chase <tchase@csc.com>, 8 " Contributors: Tim Chase <tchase@csc.com>,
9 " Stas Grabois <stsi@vtrails.com>, 9 " Stas Grabois <stsi@vtrails.com>,
10 " Mazen NEIFER <mazen.neifer.2001@supaero.fr>, 10 " Mazen NEIFER <mazen.neifer.2001@supaero.fr>,
11 " Klaus Hast <Klaus.Hast@arcor.net>, 11 " Klaus Hast <Klaus.Hast@arcor.net>,
12 " Austin Ziegler <austin@halostatue.ca>, 12 " Austin Ziegler <austin@halostatue.ca>,
13 " Markus Koenig <markus@stber-koenig.de> 13 " Markus Koenig <markus@stber-koenig.de>
14 14
15 " quit when a syntax file was already loaded 15 " quit when a syntax file was already loaded
16 if exists("b:current_syntax") 16 if exists("b:current_syntax")
17 finish 17 finish
18 endif 18 endif
23 23
24 syn keyword pascalBoolean true false 24 syn keyword pascalBoolean true false
25 syn keyword pascalConditional if else then 25 syn keyword pascalConditional if else then
26 syn keyword pascalConstant nil maxint 26 syn keyword pascalConstant nil maxint
27 syn keyword pascalLabel case goto label 27 syn keyword pascalLabel case goto label
28 syn keyword pascalOperator and div downto in mod not of or packed with 28 syn keyword pascalOperator and div downto in mod not of or packed
29 syn keyword pascalRepeat do for do repeat while to until 29 syn keyword pascalRepeat do for do repeat while to until
30 syn keyword pascalStatement procedure function 30 syn keyword pascalStatement procedure function
31 syn keyword pascalStatement program begin end const var type 31 syn keyword pascalStatement program begin end const var type with
32 syn keyword pascalStruct record 32 syn keyword pascalStruct record
33 syn keyword pascalType array boolean char integer file pointer real set 33 syn keyword pascalType array boolean char integer file pointer real set
34 syn keyword pascalType string text variant 34 syn keyword pascalType string text variant
35 35
36 36
38 syn keyword pascalTodo contained TODO FIXME XXX DEBUG NOTE 38 syn keyword pascalTodo contained TODO FIXME XXX DEBUG NOTE
39 39
40 " 20010723az: When wanted, highlight the trailing whitespace -- this is 40 " 20010723az: When wanted, highlight the trailing whitespace -- this is
41 " based on c_space_errors; to enable, use "pascal_space_errors". 41 " based on c_space_errors; to enable, use "pascal_space_errors".
42 if exists("pascal_space_errors") 42 if exists("pascal_space_errors")
43 if !exists("pascal_no_trail_space_error") 43 if !exists("pascal_no_trail_space_error")
44 syn match pascalSpaceError "\s\+$" 44 syn match pascalSpaceError "\s\+$"
45 endif 45 endif
46 if !exists("pascal_no_tab_space_error") 46 if !exists("pascal_no_tab_space_error")
47 syn match pascalSpaceError " \+\t"me=e-1 47 syn match pascalSpaceError " \+\t"me=e-1
48 endif 48 endif
49 endif 49 endif
50 50
51 51
52 52
53 " String 53 " String
96 "if you prefer you can highlight the range 96 "if you prefer you can highlight the range
97 "syn match pascalMatrixDelimiter "[\d\+\.\.\d\+]" 97 "syn match pascalMatrixDelimiter "[\d\+\.\.\d\+]"
98 endif 98 endif
99 99
100 syn match pascalNumber "-\=\<\d\+\>" 100 syn match pascalNumber "-\=\<\d\+\>"
101 if !exists("pascal_traditional")
102 syn match pascalHexNumber "\$\x\+\>"
103 endif
104 if exists("pascal_fpc")
105 syn match pascalOctNumber "&\o\+\>"
106 syn match pascalBinNumber "%[01]\+\>"
107 endif
108 if exists("pascal_gpc")
109 syn match pascalExtendedNumber "\%([2-9]\|[12]\d\|3[0-6]\)#[[:alnum:]]\+\>"
110 endif
111
101 syn match pascalFloat "-\=\<\d\+\.\d\+\>" 112 syn match pascalFloat "-\=\<\d\+\.\d\+\>"
102 syn match pascalFloat "-\=\<\d\+\.\d\+[eE]-\=\d\+\>" 113 syn match pascalFloat "-\=\<\d\+\.\d\+[eE]-\=\d\+\>"
103 syn match pascalHexNumber "\$[0-9a-fA-F]\+\>" 114
115 if !exists("pascal_traditional")
116 " allow leading zeros
117 syn match pascalControlCharacter "#\%([01]\=\d\=\d\|2[0-4]\d\|25[0-5]\)\>"
118 endif
104 119
105 if exists("pascal_no_tabs") 120 if exists("pascal_no_tabs")
106 syn match pascalShowTab "\t" 121 syn match pascalShowTab "\t"
107 endif 122 endif
108 123
140 155
141 syn keyword pascalStatement constructor destructor implementation inherited 156 syn keyword pascalStatement constructor destructor implementation inherited
142 syn keyword pascalStatement interface unit uses 157 syn keyword pascalStatement interface unit uses
143 syn keyword pascalModifier absolute assembler external far forward inline 158 syn keyword pascalModifier absolute assembler external far forward inline
144 syn keyword pascalModifier interrupt near virtual 159 syn keyword pascalModifier interrupt near virtual
145 syn keyword pascalAcces private public 160 syn keyword pascalAccess private public strict
146 syn keyword pascalStruct object 161 syn keyword pascalStruct object
147 syn keyword pascalOperator shl shr xor 162 syn keyword pascalOperator shl shr xor
148 163
149 syn region pascalPreProc start="(\*\$" end="\*)" contains=pascalTodo 164 syn region pascalPreProc start="(\*\$" end="\*)" contains=pascalTodo
150 syn region pascalPreProc start="{\$" end="}" 165 syn region pascalPreProc start="{\$" end="}"
155 syn keyword pascalType ByteBool WordBool LongBool 170 syn keyword pascalType ByteBool WordBool LongBool
156 syn keyword pascalType Cardinal LongWord 171 syn keyword pascalType Cardinal LongWord
157 syn keyword pascalType Single Double Extended Comp 172 syn keyword pascalType Single Double Extended Comp
158 syn keyword pascalType PChar 173 syn keyword pascalType PChar
159 174
175 syn keyword pascalPredefined self
160 176
161 if !exists ("pascal_fpc") 177 if !exists ("pascal_fpc")
162 syn keyword pascalPredefined Result 178 syn keyword pascalPredefined Result
163 endif 179 endif
164 180
165 if exists("pascal_fpc") 181 if exists("pascal_fpc")
166 syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError 182 syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError
167 syn keyword pascalStatement fail otherwise operator 183 syn keyword pascalStatement fail otherwise operator
168 syn keyword pascalDirective popstack 184 syn keyword pascalDirective popstack
169 syn keyword pascalPredefined self
170 syn keyword pascalType ShortString AnsiString WideString 185 syn keyword pascalType ShortString AnsiString WideString
171 endif 186 endif
172 187
173 if exists("pascal_gpc") 188 if exists("pascal_gpc")
189 syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError
174 syn keyword pascalType SmallInt 190 syn keyword pascalType SmallInt
175 syn keyword pascalType AnsiChar 191 syn keyword pascalType AnsiChar
176 syn keyword pascalType PAnsiChar 192 syn keyword pascalType PAnsiChar
177 endif 193 endif
178 194
179 if exists("pascal_delphi") 195 if exists("pascal_delphi")
180 syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError 196 syn region pascalComment start="//" end="$" contains=pascalTodo,pascalSpaceError
197 syn region pascalDocumentation start="///" end="$" contains=pascalTodo,pascalSpaceError
198 syn region pascalDocumentation start="{!" end="}" contains=pascalTodo,pascalSpaceError
181 syn keyword pascalType SmallInt Int64 199 syn keyword pascalType SmallInt Int64
182 syn keyword pascalType Real48 Currency 200 syn keyword pascalType Real48 Currency
183 syn keyword pascalType AnsiChar WideChar 201 syn keyword pascalType AnsiChar WideChar
184 syn keyword pascalType ShortString AnsiString WideString 202 syn keyword pascalType ShortString AnsiString WideString
185 syn keyword pascalType PAnsiChar PWideChar 203 syn keyword pascalType PAnsiChar PWideChar
190 syn keyword pascalStatement out 208 syn keyword pascalStatement out
191 syn keyword pascalStatement library package 209 syn keyword pascalStatement library package
192 syn keyword pascalStatement initialization finalization uses exports 210 syn keyword pascalStatement initialization finalization uses exports
193 syn keyword pascalStatement property out resourcestring threadvar 211 syn keyword pascalStatement property out resourcestring threadvar
194 syn keyword pascalModifier contains 212 syn keyword pascalModifier contains
195 syn keyword pascalModifier overridden reintroduce abstract 213 syn keyword pascalModifier overridden reintroduce abstract sealed
196 syn keyword pascalModifier override export dynamic name message 214 syn keyword pascalModifier override export dynamic name message
197 syn keyword pascalModifier dispid index stored default nodefault readonly 215 syn keyword pascalModifier dispid index stored default nodefault readonly
198 syn keyword pascalModifier writeonly implements overload requires resident 216 syn keyword pascalModifier writeonly implements overload requires resident
199 syn keyword pascalAcces protected published automated 217 syn keyword pascalAccess protected published automated
200 syn keyword pascalDirective register pascal cvar cdecl stdcall safecall 218 syn keyword pascalDirective register pascal cvar cdecl stdcall safecall
201 syn keyword pascalOperator as is 219 syn keyword pascalOperator as is
202 endif 220 endif
203 221
204 if exists("pascal_no_functions") 222 if exists("pascal_no_functions")
317 endif 335 endif
318 336
319 " Define the default highlighting. 337 " Define the default highlighting.
320 " Only when an item doesn't have highlighting yet 338 " Only when an item doesn't have highlighting yet
321 339
322 hi def link pascalAcces pascalStatement 340 hi def link pascalAccess pascalStatement
323 hi def link pascalBoolean Boolean 341 hi def link pascalBoolean Boolean
324 hi def link pascalComment Comment 342 hi def link pascalComment Comment
325 hi def link pascalConditional Conditional 343 hi def link pascalDocumentation Comment
344 hi def link pascalConditional Conditional
326 hi def link pascalConstant Constant 345 hi def link pascalConstant Constant
327 hi def link pascalDelimiter Identifier 346 hi def link pascalControlCharacter Character
328 hi def link pascalDirective pascalStatement 347 hi def link pascalDelimiter Identifier
329 hi def link pascalException Exception 348 hi def link pascalDirective pascalStatement
330 hi def link pascalFloat Float 349 hi def link pascalException Exception
350 hi def link pascalFloat Float
331 hi def link pascalFunction Function 351 hi def link pascalFunction Function
332 hi def link pascalLabel Label 352 hi def link pascalLabel Label
333 hi def link pascalMatrixDelimiter Identifier 353 hi def link pascalMatrixDelimiter Identifier
334 hi def link pascalModifier Type 354 hi def link pascalModifier Type
335 hi def link pascalNumber Number 355 hi def link pascalNumber Number
356 hi def link pascalExtendedNumber Number
357 hi def link pascalBinNumber pascalNumber
358 hi def link pascalHexNumber pascalNumber
359 hi def link pascalOctNumber pascalNumber
336 hi def link pascalOperator Operator 360 hi def link pascalOperator Operator
337 hi def link pascalPredefined pascalStatement 361 hi def link pascalPredefined pascalStatement
338 hi def link pascalPreProc PreProc 362 hi def link pascalPreProc PreProc
339 hi def link pascalRepeat Repeat 363 hi def link pascalRepeat Repeat
340 hi def link pascalSpaceError Error 364 hi def link pascalSpaceError Error
341 hi def link pascalStatement Statement 365 hi def link pascalStatement Statement
342 hi def link pascalString String 366 hi def link pascalString String
343 hi def link pascalStringEscape Special 367 hi def link pascalStringEscape Special
344 hi def link pascalStringEscapeGPC Special 368 hi def link pascalStringEscapeGPC Special
345 hi def link pascalStringError Error 369 hi def link pascalStringError Error
346 hi def link pascalStruct pascalStatement 370 hi def link pascalStruct pascalStatement
347 hi def link pascalSymbolOperator pascalOperator 371 hi def link pascalSymbolOperator pascalOperator
348 hi def link pascalTodo Todo 372 hi def link pascalTodo Todo
349 hi def link pascalType Type 373 hi def link pascalType Type
350 hi def link pascalUnclassified pascalStatement 374 hi def link pascalUnclassified pascalStatement
351 " hi def link pascalAsm Assembler 375 " hi def link pascalAsm Assembler
352 hi def link pascalError Error 376 hi def link pascalError Error
353 hi def link pascalAsmKey pascalStatement 377 hi def link pascalAsmKey pascalStatement
354 hi def link pascalShowTab Error 378 hi def link pascalShowTab Error
355 379
356 380
357 381
358 let b:current_syntax = "pascal" 382 let b:current_syntax = "pascal"
359 383
360 " vim: ts=8 sw=2 384 " vim: nowrap sw=2 sts=2 ts=8 noet: