KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

289 lines
15KB

  1. <?php
  2. /*************************************************************************************
  3. * delphi.php
  4. * ----------
  5. * Author: J�rja Norbert (jnorbi@vipmail.hu), Benny Baumann (BenBE@omorphia.de)
  6. * Copyright: (c) 2004 J�rja Norbert, Benny Baumann (BenBE@omorphia.de), Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.8.10
  8. * Date Started: 2004/07/26
  9. *
  10. * Delphi (Object Pascal) language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/05/23 (1.0.7.22)
  15. * - Added description of extra language features (SF#1970248)
  16. * 2005/11/19 (1.0.3)
  17. * - Updated the very incomplete keyword and type lists
  18. * 2005/09/03 (1.0.2)
  19. * - Added support for hex numbers and string entities
  20. * 2004/11/27 (1.0.1)
  21. * - Added support for multiple object splitters
  22. * 2004/10/27 (1.0.0)
  23. * - First Release
  24. *
  25. * TODO (updated 2004/11/27)
  26. * -------------------------
  27. *
  28. *************************************************************************************
  29. *
  30. * This file is part of GeSHi.
  31. *
  32. * GeSHi is free software; you can redistribute it and/or modify
  33. * it under the terms of the GNU General Public License as published by
  34. * the Free Software Foundation; either version 2 of the License, or
  35. * (at your option) any later version.
  36. *
  37. * GeSHi is distributed in the hope that it will be useful,
  38. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  39. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  40. * GNU General Public License for more details.
  41. *
  42. * You should have received a copy of the GNU General Public License
  43. * along with GeSHi; if not, write to the Free Software
  44. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  45. *
  46. ************************************************************************************/
  47. $language_data = array (
  48. 'LANG_NAME' => 'Delphi',
  49. 'COMMENT_SINGLE' => array(1 => '//'),
  50. 'COMMENT_MULTI' => array('(*' => '*)', '{' => '}'),
  51. //Compiler directives
  52. 'COMMENT_REGEXP' => array(2 => '/\\{\\$.*?}|\\(\\*\\$.*?\\*\\)/U'),
  53. 'CASE_KEYWORDS' => 0,
  54. 'QUOTEMARKS' => array("'"),
  55. 'ESCAPE_CHAR' => '',
  56. 'KEYWORDS' => array(
  57. 1 => array(
  58. 'Abstract', 'And', 'Array', 'As', 'Asm', 'At', 'Begin', 'Case',
  59. 'Class', 'Const', 'Constructor', 'Contains', 'Destructor',
  60. 'DispInterface', 'Div', 'Do', 'DownTo', 'Else', 'End', 'Except',
  61. 'Export', 'Exports', 'External', 'File', 'Finalization', 'Finally',
  62. 'For', 'Function', 'Goto', 'If', 'Implementation', 'In', 'Inherited',
  63. 'Initialization', 'Inline', 'Interface', 'Is', 'Label', 'Library',
  64. 'Mod', 'Not', 'Object', 'Of', 'On', 'Or', 'Overload', 'Override',
  65. 'Package', 'Packed', 'Private', 'Procedure', 'Program', 'Property',
  66. 'Protected', 'Public', 'Published', 'Raise', 'Record', 'Register',
  67. 'Repeat', 'Requires', 'Resourcestring', 'Set', 'Shl', 'Shr', 'Then',
  68. 'ThreadVar', 'To', 'Try', 'Type', 'Unit', 'Until', 'Uses', 'Var',
  69. 'Virtual', 'While', 'With', 'Xor', 'assembler', 'far',
  70. 'near', 'pascal', 'cdecl', 'safecall', 'stdcall', 'varargs'
  71. ),
  72. 2 => array(
  73. 'nil', 'false', 'self', 'true', 'var', 'type', 'const'
  74. ),
  75. 3 => array(
  76. 'Abs', 'AcquireExceptionObject', 'Addr', 'AnsiToUtf8', 'Append', 'ArcTan',
  77. 'Assert', 'AssignFile', 'Assigned', 'BeginThread', 'BlockRead',
  78. 'BlockWrite', 'Break', 'ChDir', 'Chr', 'Close', 'CloseFile',
  79. 'CompToCurrency', 'CompToDouble', 'Concat', 'Continue', 'Copy', 'Cos',
  80. 'Dec', 'Delete', 'Dispose', 'DoubleToComp', 'EndThread', 'EnumModules',
  81. 'EnumResourceModules', 'Eof', 'Eoln', 'Erase', 'ExceptAddr',
  82. 'ExceptObject', 'Exclude', 'Exit', 'Exp', 'FilePos', 'FileSize',
  83. 'FillChar', 'Finalize', 'FindClassHInstance', 'FindHInstance',
  84. 'FindResourceHInstance', 'Flush', 'Frac', 'FreeMem', 'Get8087CW',
  85. 'GetDir', 'GetLastError', 'GetMem', 'GetMemoryManager',
  86. 'GetModuleFileName', 'GetVariantManager', 'Halt', 'Hi', 'High',
  87. 'IOResult', 'Inc', 'Include', 'Initialize', 'Insert', 'Int',
  88. 'IsMemoryManagerSet', 'IsVariantManagerSet', 'Length', 'Ln', 'Lo', 'Low',
  89. 'MkDir', 'Move', 'New', 'Odd', 'OleStrToStrVar', 'OleStrToString', 'Ord',
  90. 'PUCS4Chars', 'ParamCount', 'ParamStr', 'Pi', 'Pos', 'Pred', 'Ptr',
  91. 'Random', 'Randomize', 'Read', 'ReadLn', 'ReallocMem',
  92. 'ReleaseExceptionObject', 'Rename', 'Reset', 'Rewrite', 'RmDir', 'Round',
  93. 'RunError', 'Seek', 'SeekEof', 'SeekEoln', 'Set8087CW', 'SetLength',
  94. 'SetLineBreakStyle', 'SetMemoryManager', 'SetString', 'SetTextBuf',
  95. 'SetVariantManager', 'Sin', 'SizeOf', 'Slice', 'Sqr', 'Sqrt', 'Str',
  96. 'StringOfChar', 'StringToOleStr', 'StringToWideChar', 'Succ', 'Swap',
  97. 'Trunc', 'Truncate', 'TypeInfo', 'UCS4StringToWideString', 'UTF8Decode',
  98. 'UTF8Encode', 'UnicodeToUtf8', 'UniqueString', 'UpCase', 'Utf8ToAnsi',
  99. 'Utf8ToUnicode', 'Val', 'VarArrayRedim', 'VarClear',
  100. 'WideCharLenToStrVar', 'WideCharLenToString', 'WideCharToStrVar',
  101. 'WideCharToString', 'WideStringToUCS4String', 'Write', 'WriteLn',
  102. 'Abort', 'AddExitProc', 'AddTerminateProc', 'AdjustLineBreaks', 'AllocMem',
  103. 'AnsiCompareFileName', 'AnsiCompareStr', 'AnsiCompareText',
  104. 'AnsiDequotedStr', 'AnsiExtractQuotedStr', 'AnsiLastChar',
  105. 'AnsiLowerCase', 'AnsiLowerCaseFileName', 'AnsiPos', 'AnsiQuotedStr',
  106. 'AnsiSameStr', 'AnsiSameText', 'AnsiStrComp', 'AnsiStrIComp',
  107. 'AnsiStrLComp', 'AnsiStrLIComp', 'AnsiStrLastChar', 'AnsiStrLower',
  108. 'AnsiStrPos', 'AnsiStrRScan', 'AnsiStrScan', 'AnsiStrUpper',
  109. 'AnsiUpperCase', 'AnsiUpperCaseFileName', 'AppendStr', 'AssignStr',
  110. 'Beep', 'BoolToStr', 'ByteToCharIndex', 'ByteToCharLen', 'ByteType',
  111. 'CallTerminateProcs', 'ChangeFileExt', 'CharLength', 'CharToByteIndex',
  112. 'CharToByteLen', 'CompareMem', 'CompareStr', 'CompareText', 'CreateDir',
  113. 'CreateGUID', 'CurrToStr', 'CurrToStrF', 'CurrentYear', 'Date',
  114. 'DateTimeToFileDate', 'DateTimeToStr', 'DateTimeToString',
  115. 'DateTimeToSystemTime', 'DateTimeToTimeStamp', 'DateToStr', 'DayOfWeek',
  116. 'DecodeDate', 'DecodeDateFully', 'DecodeTime', 'DeleteFile',
  117. 'DirectoryExists', 'DiskFree', 'DiskSize', 'DisposeStr', 'EncodeDate',
  118. 'EncodeTime', 'ExceptionErrorMessage', 'ExcludeTrailingBackslash',
  119. 'ExcludeTrailingPathDelimiter', 'ExpandFileName', 'ExpandFileNameCase',
  120. 'ExpandUNCFileName', 'ExtractFileDir', 'ExtractFileDrive',
  121. 'ExtractFileExt', 'ExtractFileName', 'ExtractFilePath',
  122. 'ExtractRelativePath', 'ExtractShortPathName', 'FileAge', 'FileClose',
  123. 'FileCreate', 'FileDateToDateTime', 'FileExists', 'FileGetAttr',
  124. 'FileGetDate', 'FileIsReadOnly', 'FileOpen', 'FileRead', 'FileSearch',
  125. 'FileSeek', 'FileSetAttr', 'FileSetDate', 'FileSetReadOnly', 'FileWrite',
  126. 'FinalizePackage', 'FindClose', 'FindCmdLineSwitch', 'FindFirst',
  127. 'FindNext', 'FloatToCurr', 'FloatToDateTime', 'FloatToDecimal',
  128. 'FloatToStr', 'FloatToStrF', 'FloatToText', 'FloatToTextFmt',
  129. 'FmtLoadStr', 'FmtStr', 'ForceDirectories', 'Format', 'FormatBuf',
  130. 'FormatCurr', 'FormatDateTime', 'FormatFloat', 'FreeAndNil',
  131. 'GUIDToString', 'GetCurrentDir', 'GetEnvironmentVariable',
  132. 'GetFileVersion', 'GetFormatSettings', 'GetLocaleFormatSettings',
  133. 'GetModuleName', 'GetPackageDescription', 'GetPackageInfo', 'GetTime',
  134. 'IncAMonth', 'IncMonth', 'IncludeTrailingBackslash',
  135. 'IncludeTrailingPathDelimiter', 'InitializePackage', 'IntToHex',
  136. 'IntToStr', 'InterlockedDecrement', 'InterlockedExchange',
  137. 'InterlockedExchangeAdd', 'InterlockedIncrement', 'IsDelimiter',
  138. 'IsEqualGUID', 'IsLeapYear', 'IsPathDelimiter', 'IsValidIdent',
  139. 'Languages', 'LastDelimiter', 'LoadPackage', 'LoadStr', 'LowerCase',
  140. 'MSecsToTimeStamp', 'NewStr', 'NextCharIndex', 'Now', 'OutOfMemoryError',
  141. 'QuotedStr', 'RaiseLastOSError', 'RaiseLastWin32Error', 'RemoveDir',
  142. 'RenameFile', 'ReplaceDate', 'ReplaceTime', 'SafeLoadLibrary',
  143. 'SameFileName', 'SameText', 'SetCurrentDir', 'ShowException', 'Sleep',
  144. 'StrAlloc', 'StrBufSize', 'StrByteType', 'StrCat', 'StrCharLength',
  145. 'StrComp', 'StrCopy', 'StrDispose', 'StrECopy', 'StrEnd', 'StrFmt',
  146. 'StrIComp', 'StrLCat', 'StrLComp', 'StrLCopy', 'StrLFmt', 'StrLIComp',
  147. 'StrLen', 'StrLower', 'StrMove', 'StrNew', 'StrNextChar', 'StrPCopy',
  148. 'StrPLCopy', 'StrPas', 'StrPos', 'StrRScan', 'StrScan', 'StrToBool',
  149. 'StrToBoolDef', 'StrToCurr', 'StrToCurrDef', 'StrToDate', 'StrToDateDef',
  150. 'StrToDateTime', 'StrToDateTimeDef', 'StrToFloat', 'StrToFloatDef',
  151. 'StrToInt', 'StrToInt64', 'StrToInt64Def', 'StrToIntDef', 'StrToTime',
  152. 'StrToTimeDef', 'StrUpper', 'StringReplace', 'StringToGUID', 'Supports',
  153. 'SysErrorMessage', 'SystemTimeToDateTime', 'TextToFloat', 'Time',
  154. 'TimeStampToDateTime', 'TimeStampToMSecs', 'TimeToStr', 'Trim',
  155. 'TrimLeft', 'TrimRight', 'TryEncodeDate', 'TryEncodeTime',
  156. 'TryFloatToCurr', 'TryFloatToDateTime', 'TryStrToBool', 'TryStrToCurr',
  157. 'TryStrToDate', 'TryStrToDateTime', 'TryStrToFloat', 'TryStrToInt',
  158. 'TryStrToInt64', 'TryStrToTime', 'UnloadPackage', 'UpperCase',
  159. 'WideCompareStr', 'WideCompareText', 'WideFmtStr', 'WideFormat',
  160. 'WideFormatBuf', 'WideLowerCase', 'WideSameStr', 'WideSameText',
  161. 'WideUpperCase', 'Win32Check', 'WrapText',
  162. 'ActivateClassGroup', 'AllocateHwnd', 'BinToHex', 'CheckSynchronize',
  163. 'CollectionsEqual', 'CountGenerations', 'DeallocateHwnd', 'EqualRect',
  164. 'ExtractStrings', 'FindClass', 'FindGlobalComponent', 'GetClass',
  165. 'GroupDescendantsWith', 'HexToBin', 'IdentToInt',
  166. 'InitInheritedComponent', 'IntToIdent', 'InvalidPoint',
  167. 'IsUniqueGlobalComponentName', 'LineStart', 'ObjectBinaryToText',
  168. 'ObjectResourceToText', 'ObjectTextToBinary', 'ObjectTextToResource',
  169. 'PointsEqual', 'ReadComponentRes', 'ReadComponentResEx',
  170. 'ReadComponentResFile', 'Rect', 'RegisterClass', 'RegisterClassAlias',
  171. 'RegisterClasses', 'RegisterComponents', 'RegisterIntegerConsts',
  172. 'RegisterNoIcon', 'RegisterNonActiveX', 'SmallPoint', 'StartClassGroup',
  173. 'TestStreamFormat', 'UnregisterClass', 'UnregisterClasses',
  174. 'UnregisterIntegerConsts', 'UnregisterModuleClasses',
  175. 'WriteComponentResFile',
  176. 'ArcCos', 'ArcCosh', 'ArcCot', 'ArcCotH', 'ArcCsc', 'ArcCscH', 'ArcSec',
  177. 'ArcSecH', 'ArcSin', 'ArcSinh', 'ArcTan2', 'ArcTanh', 'Ceil',
  178. 'CompareValue', 'Cosecant', 'Cosh', 'Cot', 'CotH', 'Cotan', 'Csc', 'CscH',
  179. 'CycleToDeg', 'CycleToGrad', 'CycleToRad', 'DegToCycle', 'DegToGrad',
  180. 'DegToRad', 'DivMod', 'DoubleDecliningBalance', 'EnsureRange', 'Floor',
  181. 'Frexp', 'FutureValue', 'GetExceptionMask', 'GetPrecisionMode',
  182. 'GetRoundMode', 'GradToCycle', 'GradToDeg', 'GradToRad', 'Hypot',
  183. 'InRange', 'IntPower', 'InterestPayment', 'InterestRate',
  184. 'InternalRateOfReturn', 'IsInfinite', 'IsNan', 'IsZero', 'Ldexp', 'LnXP1',
  185. 'Log10', 'Log2', 'LogN', 'Max', 'MaxIntValue', 'MaxValue', 'Mean',
  186. 'MeanAndStdDev', 'Min', 'MinIntValue', 'MinValue', 'MomentSkewKurtosis',
  187. 'NetPresentValue', 'Norm', 'NumberOfPeriods', 'Payment', 'PeriodPayment',
  188. 'Poly', 'PopnStdDev', 'PopnVariance', 'Power', 'PresentValue',
  189. 'RadToCycle', 'RadToDeg', 'RadToGrad', 'RandG', 'RandomRange', 'RoundTo',
  190. 'SLNDepreciation', 'SYDDepreciation', 'SameValue', 'Sec', 'SecH',
  191. 'Secant', 'SetExceptionMask', 'SetPrecisionMode', 'SetRoundMode', 'Sign',
  192. 'SimpleRoundTo', 'SinCos', 'Sinh', 'StdDev', 'Sum', 'SumInt',
  193. 'SumOfSquares', 'SumsAndSquares', 'Tan', 'Tanh', 'TotalVariance',
  194. 'Variance'
  195. ),
  196. 4 => array(
  197. 'AnsiChar', 'AnsiString', 'Bool', 'Boolean', 'Byte', 'ByteBool', 'Cardinal', 'Char',
  198. 'Comp', 'Currency', 'DWORD', 'Double', 'Extended', 'Int64', 'Integer', 'IUnknown',
  199. 'LongBool', 'LongInt', 'LongWord', 'PAnsiChar', 'PAnsiString', 'PBool', 'PBoolean', 'PByte',
  200. 'PByteArray', 'PCardinal', 'PChar', 'PComp', 'PCurrency', 'PDWORD', 'PDate', 'PDateTime',
  201. 'PDouble', 'PExtended', 'PInt64', 'PInteger', 'PLongInt', 'PLongWord', 'Pointer', 'PPointer',
  202. 'PShortInt', 'PShortString', 'PSingle', 'PSmallInt', 'PString', 'PHandle', 'PVariant', 'PWord',
  203. 'PWordArray', 'PWordBool', 'PWideChar', 'PWideString', 'Real', 'Real48', 'ShortInt', 'ShortString',
  204. 'Single', 'SmallInt', 'String', 'TClass', 'TDate', 'TDateTime', 'TextFile', 'THandle',
  205. 'TObject', 'TTime', 'Variant', 'WideChar', 'WideString', 'Word', 'WordBool'
  206. ),
  207. ),
  208. 'CASE_SENSITIVE' => array(
  209. GESHI_COMMENTS => false,
  210. 1 => false,
  211. 2 => false,
  212. 3 => false,
  213. 4 => false,
  214. ),
  215. 'SYMBOLS' => array(
  216. 0 => array('(', ')', '[', ']'),
  217. 1 => array('.', ',', ':', ';'),
  218. 2 => array('@', '^'),
  219. 3 => array('=', '+', '-', '*', '/')
  220. ),
  221. 'STYLES' => array(
  222. 'KEYWORDS' => array(
  223. 1 => 'color: #000000; font-weight: bold;',
  224. 2 => 'color: #000000; font-weight: bold;',
  225. 3 => 'color: #000066;',
  226. 4 => 'color: #000066; font-weight: bold;'
  227. ),
  228. 'COMMENTS' => array(
  229. 1 => 'color: #808080; font-style: italic;',
  230. 2 => 'color: #008000; font-style: italic;',
  231. 'MULTI' => 'color: #808080; font-style: italic;'
  232. ),
  233. 'ESCAPE_CHAR' => array(
  234. 0 => 'color: #ff0000; font-weight: bold;'
  235. ),
  236. 'BRACKETS' => array(
  237. 0 => 'color: #000066;'
  238. ),
  239. 'STRINGS' => array(
  240. 0 => 'color: #ff0000;'
  241. ),
  242. 'NUMBERS' => array(
  243. 0 => 'color: #0000ff;'
  244. ),
  245. 'METHODS' => array(
  246. 1 => 'color: #006600;'
  247. ),
  248. 'REGEXPS' => array(
  249. 0 => 'color: #9ac;',
  250. 1 => 'color: #ff0000;'
  251. ),
  252. 'SYMBOLS' => array(
  253. 0 => 'color: #000066;',
  254. 1 => 'color: #000066;',
  255. 2 => 'color: #000066;',
  256. 3 => 'color: #000066;'
  257. ),
  258. 'SCRIPT' => array(
  259. )
  260. ),
  261. 'URLS' => array(
  262. 1 => '',
  263. 2 => '',
  264. 3 => '',
  265. 4 => ''
  266. ),
  267. 'OOLANG' => true,
  268. 'OBJECT_SPLITTERS' => array(
  269. 1 => '.'
  270. ),
  271. 'REGEXPS' => array(
  272. //Hex numbers
  273. 0 => '\$[0-9a-fA-F]+',
  274. //Characters
  275. 1 => '\#(?:\$[0-9a-fA-F]{1,2}|\d{1,3})'
  276. ),
  277. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  278. 'SCRIPT_DELIMITERS' => array(
  279. ),
  280. 'HIGHLIGHT_STRICT_BLOCK' => array(
  281. ),
  282. 'TAB_WIDTH' => 2
  283. );
  284. ?>