Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
pascal.vim385 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:		Pascal3" Maintainer:		Doug Kearns <dougkearns@gmail.com>4" Previous Maintainers:	Xavier Crégut <xavier.cregut@enseeiht.fr>5"			Mario Eusebio <bio@dq.fct.unl.pt>6" Last Change:		2021 May 207 8" Contributors: Tim Chase <tchase@csc.com>,9"		Stas Grabois <stsi@vtrails.com>,10"		Mazen NEIFER <mazen.neifer.2001@supaero.fr>,11"		Klaus Hast <Klaus.Hast@arcor.net>,12"		Austin Ziegler <austin@halostatue.ca>,13"		Markus Koenig <markus@stber-koenig.de>14 15" quit when a syntax file was already loaded16if exists("b:current_syntax")17  finish18endif19 20 21syn case ignore22syn sync lines=25023 24syn keyword pascalBoolean	true false25syn keyword pascalConditional	if else then26syn keyword pascalConstant	nil maxint27syn keyword pascalLabel		case goto label28syn keyword pascalOperator	and div downto in mod not of or packed29syn keyword pascalRepeat	do for do repeat while to until30syn keyword pascalStatement	procedure function31syn keyword pascalStatement	program begin end const var type with32syn keyword pascalStruct	record33syn keyword pascalType		array boolean char integer file pointer real set34syn keyword pascalType		string text variant35 36 37    " 20011222az: Added new items.38syn keyword pascalTodo contained	TODO FIXME XXX DEBUG NOTE39 40    " 20010723az: When wanted, highlight the trailing whitespace -- this is41    " based on c_space_errors; to enable, use "pascal_space_errors".42if exists("pascal_space_errors")43  if !exists("pascal_no_trail_space_error")44    syn match pascalSpaceError "\s\+$"45  endif46  if !exists("pascal_no_tab_space_error")47    syn match pascalSpaceError " \+\t"me=e-148  endif49endif50 51 52 53" String54if !exists("pascal_one_line_string")55  syn region  pascalString matchgroup=pascalString start=+'+ end=+'+ contains=pascalStringEscape56  if exists("pascal_gpc")57    syn region  pascalString matchgroup=pascalString start=+"+ end=+"+ contains=pascalStringEscapeGPC58  else59    syn region  pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ contains=pascalStringEscape60  endif61else62  "wrong strings63  syn region  pascalStringError matchgroup=pascalStringError start=+'+ end=+'+ end=+$+ contains=pascalStringEscape64  if exists("pascal_gpc")65    syn region  pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ end=+$+ contains=pascalStringEscapeGPC66  else67    syn region  pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ end=+$+ contains=pascalStringEscape68  endif69 70  "right strings71  syn region  pascalString matchgroup=pascalString start=+'+ end=+'+ oneline contains=pascalStringEscape72  " To see the start and end of strings:73  " syn region  pascalString matchgroup=pascalStringError start=+'+ end=+'+ oneline contains=pascalStringEscape74  if exists("pascal_gpc")75    syn region  pascalString matchgroup=pascalString start=+"+ end=+"+ oneline contains=pascalStringEscapeGPC76  else77    syn region  pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ oneline contains=pascalStringEscape78  endif79end80syn match   pascalStringEscape		contained "''"81syn match   pascalStringEscapeGPC	contained '""'82 83 84" syn match   pascalIdentifier		"\<[a-zA-Z_][a-zA-Z0-9_]*\>"85 86 87if exists("pascal_symbol_operator")88  syn match   pascalSymbolOperator      "[+\-/*=]"89  syn match   pascalSymbolOperator      "[<>]=\="90  syn match   pascalSymbolOperator      "<>"91  syn match   pascalSymbolOperator      ":="92  syn match   pascalSymbolOperator      "[()]"93  syn match   pascalSymbolOperator      "\.\."94  syn match   pascalSymbolOperator       "[\^.]"95  syn match   pascalMatrixDelimiter	"[][]"96  "if you prefer you can highlight the range97  "syn match  pascalMatrixDelimiter	"[\d\+\.\.\d\+]"98endif99 100syn match  pascalNumber		"-\=\<\d\+\>"101if !exists("pascal_traditional")102  syn match  pascalHexNumber	"\$\x\+\>"103endif104if exists("pascal_fpc")105  syn match	pascalOctNumber "&\o\+\>"106  syn match	pascalBinNumber	"%[01]\+\>"107endif108if exists("pascal_gpc")109  syn match  pascalExtendedNumber	"\%([2-9]\|[12]\d\|3[0-6]\)#[[:alnum:]]\+\>"110endif111 112syn match  pascalFloat		"-\=\<\d\+\.\d\+\>"113syn match  pascalFloat		"-\=\<\d\+\.\d\+[eE]-\=\d\+\>"114 115if !exists("pascal_traditional")116  " allow leading zeros117  syn match pascalControlCharacter	"#\%([01]\=\d\=\d\|2[0-4]\d\|25[0-5]\)\>"118endif119 120if exists("pascal_no_tabs")121  syn match pascalShowTab "\t"122endif123 124syn region pascalComment	start="(\*\|{"  end="\*)\|}" contains=pascalTodo,pascalSpaceError125 126 127if !exists("pascal_no_functions")128  " array functions129  syn keyword pascalFunction	pack unpack130 131  " memory function132  syn keyword pascalFunction	Dispose New133 134  " math functions135  syn keyword pascalFunction	Abs Arctan Cos Exp Ln Sin Sqr Sqrt136 137  " file functions138  syn keyword pascalFunction	Eof Eoln Write Writeln139  syn keyword pascalPredefined	Input Output140 141  if exists("pascal_traditional")142    " These functions do not seem to be defined in Turbo Pascal143    syn keyword pascalFunction	Get Page Put 144  endif145 146  " ordinal functions147  syn keyword pascalFunction	Odd Pred Succ148 149  " transfert functions150  syn keyword pascalFunction	Chr Ord Round Trunc151endif152 153 154if !exists("pascal_traditional")155 156  syn keyword pascalStatement	constructor destructor implementation inherited157  syn keyword pascalStatement	interface unit uses158  syn keyword pascalModifier	absolute assembler external far forward inline159  syn keyword pascalModifier	interrupt near virtual 160  syn keyword pascalAccess	private public strict161  syn keyword pascalStruct	object 162  syn keyword pascalOperator	shl shr xor163 164  syn region pascalPreProc	start="(\*\$"  end="\*)" contains=pascalTodo165  syn region pascalPreProc	start="{\$"  end="}"166 167  syn region  pascalAsm		matchgroup=pascalAsmKey start="\<asm\>" end="\<end\>" contains=pascalComment,pascalPreProc168 169  syn keyword pascalType	ShortInt LongInt Byte Word170  syn keyword pascalType	ByteBool WordBool LongBool171  syn keyword pascalType	Cardinal LongWord172  syn keyword pascalType	Single Double Extended Comp173  syn keyword pascalType	PChar174 175  syn keyword pascalPredefined	self176 177  if !exists ("pascal_fpc")178    syn keyword pascalPredefined	Result179  endif180 181  if exists("pascal_fpc")182    syn region pascalComment        start="//" end="$" contains=pascalTodo,pascalSpaceError183    syn keyword pascalStatement	fail otherwise operator184    syn keyword pascalDirective	popstack185    syn keyword pascalType	ShortString AnsiString WideString186  endif187 188  if exists("pascal_gpc")189    syn region pascalComment        start="//" end="$" contains=pascalTodo,pascalSpaceError190    syn keyword pascalType	SmallInt191    syn keyword pascalType	AnsiChar192    syn keyword pascalType	PAnsiChar193  endif194 195  if exists("pascal_delphi")196    syn region pascalComment	start="//"  end="$" contains=pascalTodo,pascalSpaceError197    syn region pascalDocumentation	start="///" end="$" contains=pascalTodo,pascalSpaceError198    syn region pascalDocumentation	start="{!"  end="}" contains=pascalTodo,pascalSpaceError199    syn keyword pascalType	SmallInt Int64200    syn keyword pascalType	Real48 Currency201    syn keyword pascalType	AnsiChar WideChar202    syn keyword pascalType	ShortString AnsiString WideString203    syn keyword pascalType	PAnsiChar PWideChar204    syn match  pascalFloat	"-\=\<\d\+\.\d\+[dD]-\=\d\+\>"205    syn match  pascalStringEscape	contained "#[12][0-9]\=[0-9]\="206    syn keyword pascalStruct	class dispinterface207    syn keyword pascalException	try except raise at on finally208    syn keyword pascalStatement	out209    syn keyword pascalStatement	library package 210    syn keyword pascalStatement	initialization finalization uses exports211    syn keyword pascalStatement	property out resourcestring threadvar212    syn keyword pascalModifier	contains213    syn keyword pascalModifier	overridden reintroduce abstract sealed214    syn keyword pascalModifier	override export dynamic name message215    syn keyword pascalModifier	dispid index stored default nodefault readonly216    syn keyword pascalModifier	writeonly implements overload requires resident217    syn keyword pascalAccess	protected published automated218    syn keyword pascalDirective	register pascal cvar cdecl stdcall safecall219    syn keyword pascalOperator	as is220  endif221 222  if exists("pascal_no_functions")223    "syn keyword pascalModifier	read write224    "may confuse with Read and Write functions.  Not easy to handle.225  else226    " control flow functions227    syn keyword pascalFunction	Break Continue Exit Halt RunError228 229    " ordinal functions230    syn keyword pascalFunction	Dec Inc High Low231 232    " math functions233    syn keyword pascalFunction	Frac Int Pi234 235    " string functions236    syn keyword pascalFunction	Concat Copy Delete Insert Length Pos Str Val237 238    " memory function239    syn keyword pascalFunction	FreeMem GetMem MaxAvail MemAvail240 241    " pointer and address functions242    syn keyword pascalFunction	Addr Assigned CSeg DSeg Ofs Ptr Seg SPtr SSeg243 244    " misc functions245    syn keyword pascalFunction	Exclude FillChar Hi Include Lo Move ParamCount246    syn keyword pascalFunction	ParamStr Random Randomize SizeOf Swap TypeOf247    syn keyword pascalFunction	UpCase248 249    " predefined variables250    syn keyword pascalPredefined ErrorAddr ExitCode ExitProc FileMode FreeList251    syn keyword pascalPredefined FreeZero HeapEnd HeapError HeapOrg HeapPtr252    syn keyword pascalPredefined InOutRes OvrCodeList OvrDebugPtr OvrDosHandle253    syn keyword pascalPredefined OvrEmsHandle OvrHeapEnd OvrHeapOrg OvrHeapPtr254    syn keyword pascalPredefined OvrHeapSize OvrLoadList PrefixSeg RandSeed255    syn keyword pascalPredefined SaveInt00 SaveInt02 SaveInt1B SaveInt21256    syn keyword pascalPredefined SaveInt23 SaveInt24 SaveInt34 SaveInt35257    syn keyword pascalPredefined SaveInt36 SaveInt37 SaveInt38 SaveInt39258    syn keyword pascalPredefined SaveInt3A SaveInt3B SaveInt3C SaveInt3D259    syn keyword pascalPredefined SaveInt3E SaveInt3F SaveInt75 SegA000 SegB000260    syn keyword pascalPredefined SegB800 SelectorInc StackLimit Test8087261 262    " file functions263    syn keyword pascalFunction	Append Assign BlockRead BlockWrite ChDir Close264    syn keyword pascalFunction	Erase FilePos FileSize Flush GetDir IOResult265    syn keyword pascalFunction	MkDir Read Readln Rename Reset Rewrite RmDir266    syn keyword pascalFunction	Seek SeekEof SeekEoln SetTextBuf Truncate267 268    " crt unit269    syn keyword pascalFunction	AssignCrt ClrEol ClrScr Delay DelLine GotoXY270    syn keyword pascalFunction	HighVideo InsLine KeyPressed LowVideo NormVideo271    syn keyword pascalFunction	NoSound ReadKey Sound TextBackground TextColor272    syn keyword pascalFunction	TextMode WhereX WhereY Window273    syn keyword pascalPredefined CheckBreak CheckEOF CheckSnow DirectVideo274    syn keyword pascalPredefined LastMode TextAttr WindMin WindMax275    syn keyword pascalFunction BigCursor CursorOff CursorOn276    syn keyword pascalConstant Black Blue Green Cyan Red Magenta Brown277    syn keyword pascalConstant LightGray DarkGray LightBlue LightGreen278    syn keyword pascalConstant LightCyan LightRed LightMagenta Yellow White279    syn keyword pascalConstant Blink ScreenWidth ScreenHeight bw40280    syn keyword pascalConstant co40 bw80 co80 mono281    syn keyword pascalPredefined TextChar 282 283    " DOS unit284    syn keyword pascalFunction	AddDisk DiskFree DiskSize DosExitCode DosVersion285    syn keyword pascalFunction	EnvCount EnvStr Exec Expand FindClose FindFirst286    syn keyword pascalFunction	FindNext FSearch FSplit GetCBreak GetDate287    syn keyword pascalFunction	GetEnv GetFAttr GetFTime GetIntVec GetTime288    syn keyword pascalFunction	GetVerify Intr Keep MSDos PackTime SetCBreak289    syn keyword pascalFunction	SetDate SetFAttr SetFTime SetIntVec SetTime290    syn keyword pascalFunction	SetVerify SwapVectors UnPackTime291    syn keyword pascalConstant	FCarry FParity FAuxiliary FZero FSign FOverflow292    syn keyword pascalConstant	Hidden Sysfile VolumeId Directory Archive293    syn keyword pascalConstant	AnyFile fmClosed fmInput fmOutput fmInout294    syn keyword pascalConstant	TextRecNameLength TextRecBufSize295    syn keyword pascalType	ComStr PathStr DirStr NameStr ExtStr SearchRec296    syn keyword pascalType	FileRec TextBuf TextRec Registers DateTime297    syn keyword pascalPredefined DosError298 299    "Graph Unit300    syn keyword pascalFunction	Arc Bar Bar3D Circle ClearDevice ClearViewPort301    syn keyword pascalFunction	CloseGraph DetectGraph DrawPoly Ellipse302    syn keyword pascalFunction	FillEllipse FillPoly FloodFill GetArcCoords303    syn keyword pascalFunction	GetAspectRatio GetBkColor GetColor304    syn keyword pascalFunction	GetDefaultPalette GetDriverName GetFillPattern305    syn keyword pascalFunction	GetFillSettings GetGraphMode GetImage306    syn keyword pascalFunction	GetLineSettings GetMaxColor GetMaxMode GetMaxX307    syn keyword pascalFunction	GetMaxY GetModeName GetModeRange GetPalette308    syn keyword pascalFunction	GetPaletteSize GetPixel GetTextSettings309    syn keyword pascalFunction	GetViewSettings GetX GetY GraphDefaults310    syn keyword pascalFunction	GraphErrorMsg GraphResult ImageSize InitGraph311    syn keyword pascalFunction	InstallUserDriver InstallUserFont Line LineRel312    syn keyword pascalFunction	LineTo MoveRel MoveTo OutText OutTextXY313    syn keyword pascalFunction	PieSlice PutImage PutPixel Rectangle314    syn keyword pascalFunction	RegisterBGIDriver RegisterBGIFont315    syn keyword pascalFunction	RestoreCRTMode Sector SetActivePage316    syn keyword pascalFunction	SetAllPallette SetAspectRatio SetBkColor317    syn keyword pascalFunction	SetColor SetFillPattern SetFillStyle318    syn keyword pascalFunction	SetGraphBufSize SetGraphMode SetLineStyle319    syn keyword pascalFunction	SetPalette SetRGBPalette SetTextJustify320    syn keyword pascalFunction	SetTextStyle SetUserCharSize SetViewPort321    syn keyword pascalFunction	SetVisualPage SetWriteMode TextHeight TextWidth322    syn keyword pascalType	ArcCoordsType FillPatternType FillSettingsType323    syn keyword pascalType	LineSettingsType PaletteType PointType324    syn keyword pascalType	TextSettingsType ViewPortType325 326    " string functions327    syn keyword pascalFunction	StrAlloc StrBufSize StrCat StrComp StrCopy328    syn keyword pascalFunction	StrDispose StrECopy StrEnd StrFmt StrIComp329    syn keyword pascalFunction	StrLCat StrLComp StrLCopy StrLen StrLFmt330    syn keyword pascalFunction	StrLIComp StrLower StrMove StrNew StrPas331    syn keyword pascalFunction	StrPCopy StrPLCopy StrPos StrRScan StrScan332    syn keyword pascalFunction	StrUpper333  endif334 335endif336 337" Define the default highlighting.338" Only when an item doesn't have highlighting yet339 340hi def link pascalAccess		pascalStatement341hi def link pascalBoolean		Boolean342hi def link pascalComment		Comment343hi def link pascalDocumentation		Comment344hi def link pascalConditional		Conditional345hi def link pascalConstant		Constant346hi def link pascalControlCharacter	Character347hi def link pascalDelimiter		Identifier348hi def link pascalDirective		pascalStatement349hi def link pascalException		Exception350hi def link pascalFloat			Float351hi def link pascalFunction		Function352hi def link pascalLabel			Label353hi def link pascalMatrixDelimiter	Identifier354hi def link pascalModifier		Type355hi def link pascalNumber		Number356hi def link pascalExtendedNumber	Number357hi def link pascalBinNumber		pascalNumber358hi def link pascalHexNumber		pascalNumber359hi def link pascalOctNumber		pascalNumber360hi def link pascalOperator		Operator361hi def link pascalPredefined		pascalStatement362hi def link pascalPreProc		PreProc363hi def link pascalRepeat		Repeat364hi def link pascalSpaceError		Error365hi def link pascalStatement		Statement366hi def link pascalString		String367hi def link pascalStringEscape		Special368hi def link pascalStringEscapeGPC	Special369hi def link pascalStringError		Error370hi def link pascalStruct		pascalStatement371hi def link pascalSymbolOperator	pascalOperator372hi def link pascalTodo			Todo373hi def link pascalType			Type374hi def link pascalUnclassified		pascalStatement375"  hi def link pascalAsm		Assembler376hi def link pascalError			Error377hi def link pascalAsmKey		pascalStatement378hi def link pascalShowTab		Error379 380 381 382let b:current_syntax = "pascal"383 384" vim: nowrap sw=2 sts=2 ts=8 noet:385 
codekingpro/portable-devtools · Team Ai