1 {-------------------------------------------------------------------------------
2 The contents of this file are subject to the Mozilla Public License
3 Version 1.1 (the "License"); you may not use this file except in compliance
4 with the License. You may obtain a copy of the License at
5 http://www.mozilla.org/MPL/
6
7 Software distributed under the License is distributed on an "AS IS" basis,
8 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9 the specific language governing rights and limitations under the License.
10
11 The Original Code is: SynHighlighterPerl.pas, released 2000-04-10.
12 The Original Code is based on the DcjSynPerl.pas file from the
13 mwEdit component suite by Martin Waldenburg and other developers, the Initial
14 Author of this file is Michael Trier.
15 All Rights Reserved.
16
17 Contributors to the SynEdit and mwEdit projects are listed in the
18 Contributors.txt file.
19
20 Alternatively, the contents of this file may be used under the terms of the
21 GNU General Public License Version 2 or later (the "GPL"), in which case
22 the provisions of the GPL are applicable instead of those above.
23 If you wish to allow use of your version of this file only under the terms
24 of the GPL and not to allow others to use your version of this file
25 under the MPL, indicate your decision by deleting the provisions above and
26 replace them with the notice and other provisions required by the GPL.
27 If you do not delete the provisions above, a recipient may use your version
28 of this file under either the MPL or the GPL.
29
30 $Id$
31
32 You may retrieve the latest version of this file at the SynEdit home page,
33 located at http://SynEdit.SourceForge.net
34
35 Known Issues:
36 - Using q, qq, qw, qx, m, s, tr will not properly parse the contained
37 information.
38 - Not very optimized.
39 -------------------------------------------------------------------------------}
40 {
41 @abstract(Provides a Perl syntax highlighter for SynEdit)
42 @author(Michael Trier)
43 @created(1999, converted to SynEdit 2000-04-10 by Michael Hieke)
44 @lastmod(2000-06-23)
45 The SynHighlighterPerl unit provides SynEdit with a Perl syntax highlighter.
46 }
47 unit SynHighlighterPerl;
48
49 {$I synedit.inc}
50
51 interface
52
53 uses
54 SysUtils, Classes,
55 LCLIntf, LCLType,
56 Controls, Graphics,
57 SynEditTypes, SynEditHighlighter, SynEditStrConst;
58
59 type
60 TtkTokenKind = (tkComment, tkIdentifier, tkKey, tkNull, tkNumber, tkOperator,
61 tkPragma, tkSpace, tkString, tkSymbol, tkUnknown, tkVariable);
62
63 TProcTableProc = procedure of object;
TtkTokenKindnull64 TIdentFuncTableFunc = function: TtkTokenKind of object;
65
66 TSynPerlSyn = class(TSynCustomHighlighter)
67 private
68 fLine: PChar;
69 fProcTable: array[#0..#255] of TProcTableProc;
70 Run: LongInt;
71 fStringLen: Integer;
72 fToIdent: PChar;
73 fTokenPos: Integer;
74 FTokenID: TtkTokenKind;
75 fIdentFuncTable: array[0..2167] of TIdentFuncTableFunc;
76 fLineNumber: Integer;
77 fCommentAttri: TSynHighlighterAttributes;
78 fIdentifierAttri: TSynHighlighterAttributes;
79 fInvalidAttri: TSynHighlighterAttributes;
80 fKeyAttri: TSynHighlighterAttributes;
81 fNumberAttri: TSynHighlighterAttributes;
82 fOperatorAttri: TSynHighlighterAttributes;
83 fPragmaAttri: TSynHighlighterAttributes;
84 fSpaceAttri: TSynHighlighterAttributes;
85 fStringAttri: TSynHighlighterAttributes;
86 fSymbolAttri: TSynHighlighterAttributes;
87 fVariableAttri: TSynHighlighterAttributes;
KeyHashnull88 function KeyHash(ToHash: PChar): Integer;
KeyCompnull89 function KeyComp(const aKey: String): Boolean;
Func109null90 function Func109: TtkTokenKind;
Func113null91 function Func113: TtkTokenKind;
Func196null92 function Func196: TtkTokenKind;
Func201null93 function Func201: TtkTokenKind;
Func204null94 function Func204: TtkTokenKind;
Func207null95 function Func207: TtkTokenKind;
Func209null96 function Func209: TtkTokenKind;
Func211null97 function Func211: TtkTokenKind;
Func214null98 function Func214: TtkTokenKind;
Func216null99 function Func216: TtkTokenKind;
Func219null100 function Func219: TtkTokenKind;
Func221null101 function Func221: TtkTokenKind;
Func224null102 function Func224: TtkTokenKind;
Func225null103 function Func225: TtkTokenKind;
Func226null104 function Func226: TtkTokenKind;
Func230null105 function Func230: TtkTokenKind;
Func232null106 function Func232: TtkTokenKind;
Func233null107 function Func233: TtkTokenKind;
Func248null108 function Func248: TtkTokenKind;
Func254null109 function Func254: TtkTokenKind;
Func255null110 function Func255: TtkTokenKind;
Func257null111 function Func257: TtkTokenKind;
Func262null112 function Func262: TtkTokenKind;
Func263null113 function Func263: TtkTokenKind;
Func269null114 function Func269: TtkTokenKind;
Func280null115 function Func280: TtkTokenKind;
Func282null116 function Func282: TtkTokenKind;
Func306null117 function Func306: TtkTokenKind;
Func307null118 function Func307: TtkTokenKind;
Func310null119 function Func310: TtkTokenKind;
Func314null120 function Func314: TtkTokenKind;
Func317null121 function Func317: TtkTokenKind;
Func318null122 function Func318: TtkTokenKind;
Func320null123 function Func320: TtkTokenKind;
Func322null124 function Func322: TtkTokenKind;
Func325null125 function Func325: TtkTokenKind;
Func326null126 function Func326: TtkTokenKind;
Func327null127 function Func327: TtkTokenKind;
Func330null128 function Func330: TtkTokenKind;
Func331null129 function Func331: TtkTokenKind;
Func333null130 function Func333: TtkTokenKind;
Func335null131 function Func335: TtkTokenKind;
Func337null132 function Func337: TtkTokenKind;
Func338null133 function Func338: TtkTokenKind;
Func340null134 function Func340: TtkTokenKind;
Func345null135 function Func345: TtkTokenKind;
Func346null136 function Func346: TtkTokenKind;
Func368null137 function Func368: TtkTokenKind;
Func401null138 function Func401: TtkTokenKind;
Func412null139 function Func412: TtkTokenKind;
Func413null140 function Func413: TtkTokenKind;
Func415null141 function Func415: TtkTokenKind;
Func419null142 function Func419: TtkTokenKind;
Func420null143 function Func420: TtkTokenKind;
Func421null144 function Func421: TtkTokenKind;
Func424null145 function Func424: TtkTokenKind;
Func425null146 function Func425: TtkTokenKind;
Func426null147 function Func426: TtkTokenKind;
Func428null148 function Func428: TtkTokenKind;
Func430null149 function Func430: TtkTokenKind;
Func431null150 function Func431: TtkTokenKind;
Func432null151 function Func432: TtkTokenKind;
Func433null152 function Func433: TtkTokenKind;
Func434null153 function Func434: TtkTokenKind;
Func436null154 function Func436: TtkTokenKind;
Func437null155 function Func437: TtkTokenKind;
Func438null156 function Func438: TtkTokenKind;
Func439null157 function Func439: TtkTokenKind;
Func440null158 function Func440: TtkTokenKind;
Func441null159 function Func441: TtkTokenKind;
Func442null160 function Func442: TtkTokenKind;
Func444null161 function Func444: TtkTokenKind;
Func445null162 function Func445: TtkTokenKind;
Func447null163 function Func447: TtkTokenKind;
Func448null164 function Func448: TtkTokenKind;
Func456null165 function Func456: TtkTokenKind;
Func458null166 function Func458: TtkTokenKind;
Func470null167 function Func470: TtkTokenKind;
Func477null168 function Func477: TtkTokenKind;
Func502null169 function Func502: TtkTokenKind;
Func522null170 function Func522: TtkTokenKind;
Func523null171 function Func523: TtkTokenKind;
Func525null172 function Func525: TtkTokenKind;
Func527null173 function Func527: TtkTokenKind;
Func530null174 function Func530: TtkTokenKind;
Func531null175 function Func531: TtkTokenKind;
Func534null176 function Func534: TtkTokenKind;
Func535null177 function Func535: TtkTokenKind;
Func536null178 function Func536: TtkTokenKind;
Func537null179 function Func537: TtkTokenKind;
Func539null180 function Func539: TtkTokenKind;
Func542null181 function Func542: TtkTokenKind;
Func543null182 function Func543: TtkTokenKind;
Func545null183 function Func545: TtkTokenKind;
Func546null184 function Func546: TtkTokenKind;
Func547null185 function Func547: TtkTokenKind;
Func548null186 function Func548: TtkTokenKind;
Func549null187 function Func549: TtkTokenKind;
Func552null188 function Func552: TtkTokenKind;
Func555null189 function Func555: TtkTokenKind;
Func556null190 function Func556: TtkTokenKind;
Func557null191 function Func557: TtkTokenKind;
Func562null192 function Func562: TtkTokenKind;
Func569null193 function Func569: TtkTokenKind;
Func570null194 function Func570: TtkTokenKind;
Func622null195 function Func622: TtkTokenKind;
Func624null196 function Func624: TtkTokenKind;
Func627null197 function Func627: TtkTokenKind;
Func630null198 function Func630: TtkTokenKind;
Func632null199 function Func632: TtkTokenKind;
Func637null200 function Func637: TtkTokenKind;
Func640null201 function Func640: TtkTokenKind;
Func642null202 function Func642: TtkTokenKind;
Func643null203 function Func643: TtkTokenKind;
Func645null204 function Func645: TtkTokenKind;
Func647null205 function Func647: TtkTokenKind;
Func648null206 function Func648: TtkTokenKind;
Func649null207 function Func649: TtkTokenKind;
Func650null208 function Func650: TtkTokenKind;
Func651null209 function Func651: TtkTokenKind;
Func652null210 function Func652: TtkTokenKind;
Func655null211 function Func655: TtkTokenKind;
Func656null212 function Func656: TtkTokenKind;
Func657null213 function Func657: TtkTokenKind;
Func658null214 function Func658: TtkTokenKind;
Func665null215 function Func665: TtkTokenKind;
Func666null216 function Func666: TtkTokenKind;
Func667null217 function Func667: TtkTokenKind;
Func672null218 function Func672: TtkTokenKind;
Func675null219 function Func675: TtkTokenKind;
Func677null220 function Func677: TtkTokenKind;
Func687null221 function Func687: TtkTokenKind;
Func688null222 function Func688: TtkTokenKind;
Func716null223 function Func716: TtkTokenKind;
Func719null224 function Func719: TtkTokenKind;
Func727null225 function Func727: TtkTokenKind;
Func728null226 function Func728: TtkTokenKind;
Func731null227 function Func731: TtkTokenKind;
Func734null228 function Func734: TtkTokenKind;
Func740null229 function Func740: TtkTokenKind;
Func741null230 function Func741: TtkTokenKind;
Func743null231 function Func743: TtkTokenKind;
Func746null232 function Func746: TtkTokenKind;
Func749null233 function Func749: TtkTokenKind;
Func750null234 function Func750: TtkTokenKind;
Func752null235 function Func752: TtkTokenKind;
Func753null236 function Func753: TtkTokenKind;
Func754null237 function Func754: TtkTokenKind;
Func759null238 function Func759: TtkTokenKind;
Func761null239 function Func761: TtkTokenKind;
Func762null240 function Func762: TtkTokenKind;
Func763null241 function Func763: TtkTokenKind;
Func764null242 function Func764: TtkTokenKind;
Func765null243 function Func765: TtkTokenKind;
Func768null244 function Func768: TtkTokenKind;
Func769null245 function Func769: TtkTokenKind;
Func773null246 function Func773: TtkTokenKind;
Func774null247 function Func774: TtkTokenKind;
Func775null248 function Func775: TtkTokenKind;
Func815null249 function Func815: TtkTokenKind;
Func821null250 function Func821: TtkTokenKind;
Func841null251 function Func841: TtkTokenKind;
Func842null252 function Func842: TtkTokenKind;
Func845null253 function Func845: TtkTokenKind;
Func853null254 function Func853: TtkTokenKind;
Func855null255 function Func855: TtkTokenKind;
Func857null256 function Func857: TtkTokenKind;
Func860null257 function Func860: TtkTokenKind;
Func864null258 function Func864: TtkTokenKind;
Func867null259 function Func867: TtkTokenKind;
Func868null260 function Func868: TtkTokenKind;
Func869null261 function Func869: TtkTokenKind;
Func870null262 function Func870: TtkTokenKind;
Func873null263 function Func873: TtkTokenKind;
Func874null264 function Func874: TtkTokenKind;
Func876null265 function Func876: TtkTokenKind;
Func877null266 function Func877: TtkTokenKind;
Func878null267 function Func878: TtkTokenKind;
Func881null268 function Func881: TtkTokenKind;
Func883null269 function Func883: TtkTokenKind;
Func890null270 function Func890: TtkTokenKind;
Func892null271 function Func892: TtkTokenKind;
Func906null272 function Func906: TtkTokenKind;
Func933null273 function Func933: TtkTokenKind;
Func954null274 function Func954: TtkTokenKind;
Func956null275 function Func956: TtkTokenKind;
Func965null276 function Func965: TtkTokenKind;
Func968null277 function Func968: TtkTokenKind;
Func974null278 function Func974: TtkTokenKind;
Func978null279 function Func978: TtkTokenKind;
Func981null280 function Func981: TtkTokenKind;
Func985null281 function Func985: TtkTokenKind;
Func986null282 function Func986: TtkTokenKind;
Func988null283 function Func988: TtkTokenKind;
Func1056null284 function Func1056: TtkTokenKind;
Func1077null285 function Func1077: TtkTokenKind;
Func1079null286 function Func1079: TtkTokenKind;
Func1084null287 function Func1084: TtkTokenKind;
Func1086null288 function Func1086: TtkTokenKind;
Func1091null289 function Func1091: TtkTokenKind;
Func1093null290 function Func1093: TtkTokenKind;
Func1095null291 function Func1095: TtkTokenKind;
Func1103null292 function Func1103: TtkTokenKind;
Func1105null293 function Func1105: TtkTokenKind;
Func1107null294 function Func1107: TtkTokenKind;
Func1136null295 function Func1136: TtkTokenKind;
Func1158null296 function Func1158: TtkTokenKind;
Func1165null297 function Func1165: TtkTokenKind;
Func1169null298 function Func1169: TtkTokenKind;
Func1172null299 function Func1172: TtkTokenKind;
Func1176null300 function Func1176: TtkTokenKind;
Func1202null301 function Func1202: TtkTokenKind;
Func1211null302 function Func1211: TtkTokenKind;
Func1215null303 function Func1215: TtkTokenKind;
Func1218null304 function Func1218: TtkTokenKind;
Func1223null305 function Func1223: TtkTokenKind;
Func1230null306 function Func1230: TtkTokenKind;
Func1273null307 function Func1273: TtkTokenKind;
Func1277null308 function Func1277: TtkTokenKind;
Func1283null309 function Func1283: TtkTokenKind;
Func1327null310 function Func1327: TtkTokenKind;
Func1343null311 function Func1343: TtkTokenKind;
Func1361null312 function Func1361: TtkTokenKind;
Func1379null313 function Func1379: TtkTokenKind;
Func1396null314 function Func1396: TtkTokenKind;
Func1402null315 function Func1402: TtkTokenKind;
Func1404null316 function Func1404: TtkTokenKind;
Func1409null317 function Func1409: TtkTokenKind;
Func1421null318 function Func1421: TtkTokenKind;
Func1425null319 function Func1425: TtkTokenKind;
Func1440null320 function Func1440: TtkTokenKind;
Func1520null321 function Func1520: TtkTokenKind;
Func1523null322 function Func1523: TtkTokenKind;
Func1673null323 function Func1673: TtkTokenKind;
Func1752null324 function Func1752: TtkTokenKind;
Func1762null325 function Func1762: TtkTokenKind;
Func1768null326 function Func1768: TtkTokenKind;
Func2167null327 function Func2167: TtkTokenKind;
328 procedure AndSymbolProc;
329 procedure CRProc;
330 procedure ColonProc;
331 procedure CommentProc;
332 procedure EqualProc;
333 procedure GreaterProc;
334 procedure IdentProc;
335 procedure LFProc;
336 procedure LowerProc;
337 procedure MinusProc;
338 procedure NotSymbolProc;
339 procedure NullProc;
340 procedure NumberProc;
341 procedure OrSymbolProc;
342 procedure PlusProc;
343 procedure SlashProc;
344 procedure SpaceProc;
345 procedure StarProc;
346 procedure StringInterpProc;
347 procedure StringLiteralProc;
348 procedure SymbolProc;
349 procedure XOrSymbolProc;
350 procedure UnknownProc;
AltFuncnull351 function AltFunc: TtkTokenKind;
352 procedure InitIdent;
IdentKindnull353 function IdentKind(MayBe: PChar): TtkTokenKind;
354 procedure MakeMethodTables;
355 protected
GetIdentCharsnull356 function GetIdentChars: TSynIdentChars; override;
357 public
GetLanguageNamenull358 class function GetLanguageName: string; override;
359 public
360 constructor Create(AOwner: TComponent); override;
GetDefaultAttributenull361 function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
362 override;
GetEolnull363 function GetEol: Boolean; override;
GetTokenIDnull364 function GetTokenID: TtkTokenKind;
365 procedure SetLine(const NewValue: String;
366 LineNumber:Integer); override;
GetTokennull367 function GetToken: String; override;
368 procedure GetTokenEx(out TokenStart: PChar; out TokenLength: integer); override;
GetTokenAttributenull369 function GetTokenAttribute: TSynHighlighterAttributes; override;
GetTokenKindnull370 function GetTokenKind: integer; override;
GetTokenPosnull371 function GetTokenPos: Integer; override;
372 procedure Next; override;
373 published
374 property CommentAttri: TSynHighlighterAttributes read fCommentAttri
375 write fCommentAttri;
376 property IdentifierAttri: TSynHighlighterAttributes read fIdentifierAttri
377 write fIdentifierAttri;
378 property InvalidAttri: TSynHighlighterAttributes read fInvalidAttri
379 write fInvalidAttri;
380 property KeyAttri: TSynHighlighterAttributes read fKeyAttri write fKeyAttri;
381 property NumberAttri: TSynHighlighterAttributes read fNumberAttri
382 write fNumberAttri;
383 property OperatorAttri: TSynHighlighterAttributes read fOperatorAttri
384 write fOperatorAttri;
385 property PragmaAttri: TSynHighlighterAttributes read fPragmaAttri
386 write fPragmaAttri;
387 property SpaceAttri: TSynHighlighterAttributes read fSpaceAttri
388 write fSpaceAttri;
389 property StringAttri: TSynHighlighterAttributes read fStringAttri
390 write fStringAttri;
391 property SymbolAttri: TSynHighlighterAttributes read fSymbolAttri
392 write fSymbolAttri;
393 property VariableAttri: TSynHighlighterAttributes read fVariableAttri
394 write fVariableAttri;
395 end;
396
397 implementation
398
399 var
400 Identifiers: array[#0..#255] of ByteBool;
401 // mHashTable: array[#0..#255] of Integer;
402
403 procedure MakeIdentTable;
404 var
405 I: Char;
406 begin
407 for I := #0 to #255 do
408 begin
409 Case I of
410 '_', '0'..'9', 'a'..'z', 'A'..'Z': Identifiers[I] := True;
411 else Identifiers[I] := False;
412 end;
413 {Case I in['%', '@', '$', '_', 'a'..'z', 'A'..'Z'] of
414 True:
415 begin
416 if (I > #64) and (I < #91) then mHashTable[I] := Ord(I) - 64 else
417 if (I > #96) then mHashTable[I] := Ord(I) - 95;
418 end;
419 else mHashTable[I] := 0;
420 end;}
421 end;
422 end;
423
424 procedure TSynPerlSyn.InitIdent;
425 var
426 I: Integer;
427 begin
428 for I := 0 to 2167 do
429 Case I of
430 109: fIdentFuncTable[I] := @Func109;
431 113: fIdentFuncTable[I] :=@func113;
432 196: fIdentFuncTable[I] :=@func196;
433 201: fIdentFuncTable[I] :=@func201;
434 204: fIdentFuncTable[I] :=@func204;
435 207: fIdentFuncTable[I] :=@func207;
436 209: fIdentFuncTable[I] :=@func209;
437 211: fIdentFuncTable[I] :=@func211;
438 214: fIdentFuncTable[I] :=@func214;
439 216: fIdentFuncTable[I] :=@func216;
440 219: fIdentFuncTable[I] :=@func219;
441 221: fIdentFuncTable[I] :=@func221;
442 224: fIdentFuncTable[I] :=@func224;
443 225: fIdentFuncTable[I] :=@func225;
444 226: fIdentFuncTable[I] :=@func226;
445 230: fIdentFuncTable[I] :=@func230;
446 232: fIdentFuncTable[I] :=@func232;
447 233: fIdentFuncTable[I] :=@func233;
448 248: fIdentFuncTable[I] :=@func248;
449 254: fIdentFuncTable[I] :=@func254;
450 255: fIdentFuncTable[I] :=@func255;
451 257: fIdentFuncTable[I] :=@func257;
452 262: fIdentFuncTable[I] :=@func262;
453 263: fIdentFuncTable[I] :=@func263;
454 269: fIdentFuncTable[I] :=@func269;
455 280: fIdentFuncTable[I] :=@func280;
456 282: fIdentFuncTable[I] :=@func282;
457 306: fIdentFuncTable[I] :=@func306;
458 307: fIdentFuncTable[I] :=@func307;
459 310: fIdentFuncTable[I] :=@func310;
460 314: fIdentFuncTable[I] :=@func314;
461 317: fIdentFuncTable[I] :=@func317;
462 318: fIdentFuncTable[I] :=@func318;
463 320: fIdentFuncTable[I] :=@func320;
464 322: fIdentFuncTable[I] :=@func322;
465 325: fIdentFuncTable[I] :=@func325;
466 326: fIdentFuncTable[I] :=@func326;
467 327: fIdentFuncTable[I] :=@func327;
468 330: fIdentFuncTable[I] :=@func330;
469 331: fIdentFuncTable[I] :=@func331;
470 333: fIdentFuncTable[I] :=@func333;
471 335: fIdentFuncTable[I] :=@func335;
472 337: fIdentFuncTable[I] :=@func337;
473 338: fIdentFuncTable[I] :=@func338;
474 340: fIdentFuncTable[I] :=@func340;
475 345: fIdentFuncTable[I] :=@func345;
476 346: fIdentFuncTable[I] :=@func346;
477 368: fIdentFuncTable[I] :=@func368;
478 401: fIdentFuncTable[I] :=@func401;
479 412: fIdentFuncTable[I] :=@func412;
480 413: fIdentFuncTable[I] :=@func413;
481 415: fIdentFuncTable[I] :=@func415;
482 419: fIdentFuncTable[I] :=@func419;
483 420: fIdentFuncTable[I] :=@func420;
484 421: fIdentFuncTable[I] :=@func421;
485 424: fIdentFuncTable[I] :=@func424;
486 425: fIdentFuncTable[I] :=@func425;
487 426: fIdentFuncTable[I] :=@func426;
488 428: fIdentFuncTable[I] :=@func428;
489 430: fIdentFuncTable[I] :=@func430;
490 431: fIdentFuncTable[I] :=@func431;
491 432: fIdentFuncTable[I] :=@func432;
492 433: fIdentFuncTable[I] :=@func433;
493 434: fIdentFuncTable[I] :=@func434;
494 436: fIdentFuncTable[I] :=@func436;
495 437: fIdentFuncTable[I] :=@func437;
496 438: fIdentFuncTable[I] :=@func438;
497 439: fIdentFuncTable[I] :=@func439;
498 440: fIdentFuncTable[I] :=@func440;
499 441: fIdentFuncTable[I] :=@func441;
500 442: fIdentFuncTable[I] :=@func442;
501 444: fIdentFuncTable[I] :=@func444;
502 445: fIdentFuncTable[I] :=@func445;
503 447: fIdentFuncTable[I] :=@func447;
504 448: fIdentFuncTable[I] :=@func448;
505 456: fIdentFuncTable[I] :=@func456;
506 458: fIdentFuncTable[I] :=@func458;
507 470: fIdentFuncTable[I] :=@func470;
508 477: fIdentFuncTable[I] :=@func477;
509 502: fIdentFuncTable[I] :=@func502;
510 522: fIdentFuncTable[I] :=@func522;
511 523: fIdentFuncTable[I] :=@func523;
512 525: fIdentFuncTable[I] :=@func525;
513 527: fIdentFuncTable[I] :=@func527;
514 530: fIdentFuncTable[I] :=@func530;
515 531: fIdentFuncTable[I] :=@func531;
516 534: fIdentFuncTable[I] :=@func534;
517 535: fIdentFuncTable[I] :=@func535;
518 536: fIdentFuncTable[I] :=@func536;
519 537: fIdentFuncTable[I] :=@func537;
520 539: fIdentFuncTable[I] :=@func539;
521 542: fIdentFuncTable[I] :=@func542;
522 543: fIdentFuncTable[I] :=@func543;
523 545: fIdentFuncTable[I] :=@func545;
524 546: fIdentFuncTable[I] :=@func546;
525 547: fIdentFuncTable[I] :=@func547;
526 548: fIdentFuncTable[I] :=@func548;
527 549: fIdentFuncTable[I] :=@func549;
528 552: fIdentFuncTable[I] :=@func552;
529 555: fIdentFuncTable[I] :=@func555;
530 556: fIdentFuncTable[I] :=@func556;
531 557: fIdentFuncTable[I] :=@func557;
532 562: fIdentFuncTable[I] :=@func562;
533 569: fIdentFuncTable[I] :=@func569;
534 570: fIdentFuncTable[I] :=@func570;
535 622: fIdentFuncTable[I] :=@func622;
536 624: fIdentFuncTable[I] :=@func624;
537 627: fIdentFuncTable[I] :=@func627;
538 630: fIdentFuncTable[I] :=@func630;
539 632: fIdentFuncTable[I] :=@func632;
540 637: fIdentFuncTable[I] :=@func637;
541 640: fIdentFuncTable[I] :=@func640;
542 642: fIdentFuncTable[I] :=@func642;
543 643: fIdentFuncTable[I] :=@func643;
544 645: fIdentFuncTable[I] :=@func645;
545 647: fIdentFuncTable[I] :=@func647;
546 648: fIdentFuncTable[I] :=@func648;
547 649: fIdentFuncTable[I] :=@func649;
548 650: fIdentFuncTable[I] :=@func650;
549 651: fIdentFuncTable[I] :=@func651;
550 652: fIdentFuncTable[I] :=@func652;
551 655: fIdentFuncTable[I] := @func655;
552 656: fIdentFuncTable[I] := @func656;
553 657: fIdentFuncTable[I] := @func657;
554 658: fIdentFuncTable[I] := @func658;
555 665: fIdentFuncTable[I] := @func665;
556 666: fIdentFuncTable[I] := @func666;
557 667: fIdentFuncTable[I] := @func667;
558 672: fIdentFuncTable[I] := @func672;
559 675: fIdentFuncTable[I] := @func675;
560 677: fIdentFuncTable[I] := @func677;
561 687: fIdentFuncTable[I] := @func687;
562 688: fIdentFuncTable[I] := @func688;
563 716: fIdentFuncTable[I] := @func716;
564 719: fIdentFuncTable[I] := @func719;
565 727: fIdentFuncTable[I] := @func727;
566 728: fIdentFuncTable[I] := @func728;
567 731: fIdentFuncTable[I] := @func731;
568 734: fIdentFuncTable[I] := @func734;
569 740: fIdentFuncTable[I] := @func740;
570 741: fIdentFuncTable[I] := @func741;
571 743: fIdentFuncTable[I] := @func743;
572 746: fIdentFuncTable[I] := @func746;
573 749: fIdentFuncTable[I] := @func749;
574 750: fIdentFuncTable[I] := @func750;
575 752: fIdentFuncTable[I] := @func752;
576 753: fIdentFuncTable[I] := @func753;
577 754: fIdentFuncTable[I] := @func754;
578 759: fIdentFuncTable[I] := @func759;
579 761: fIdentFuncTable[I] := @func761;
580 762: fIdentFuncTable[I] := @func762;
581 763: fIdentFuncTable[I] := @func763;
582 764: fIdentFuncTable[I] := @func764;
583 765: fIdentFuncTable[I] := @func765;
584 768: fIdentFuncTable[I] := @func768;
585 769: fIdentFuncTable[I] := @func769;
586 773: fIdentFuncTable[I] := @func773;
587 774: fIdentFuncTable[I] := @func774;
588 775: fIdentFuncTable[I] := @func775;
589 815: fIdentFuncTable[I] := @func815;
590 821: fIdentFuncTable[I] := @func821;
591 841: fIdentFuncTable[I] := @func841;
592 842: fIdentFuncTable[I] := @func842;
593 845: fIdentFuncTable[I] := @func845;
594 853: fIdentFuncTable[I] := @func853;
595 855: fIdentFuncTable[I] := @func855;
596 857: fIdentFuncTable[I] := @func857;
597 860: fIdentFuncTable[I] := @func860;
598 864: fIdentFuncTable[I] := @func864;
599 867: fIdentFuncTable[I] := @func867;
600 868: fIdentFuncTable[I] := @func868;
601 869: fIdentFuncTable[I] := @func869;
602 870: fIdentFuncTable[I] := @func870;
603 873: fIdentFuncTable[I] := @func873;
604 874: fIdentFuncTable[I] := @func874;
605 876: fIdentFuncTable[I] := @func876;
606 877: fIdentFuncTable[I] := @func877;
607 878: fIdentFuncTable[I] := @func878;
608 881: fIdentFuncTable[I] := @func881;
609 883: fIdentFuncTable[I] := @func883;
610 890: fIdentFuncTable[I] := @func890;
611 892: fIdentFuncTable[I] := @func892;
612 906: fIdentFuncTable[I] := @func906;
613 933: fIdentFuncTable[I] := @func933;
614 954: fIdentFuncTable[I] := @func954;
615 956: fIdentFuncTable[I] := @func956;
616 965: fIdentFuncTable[I] := @func965;
617 968: fIdentFuncTable[I] := @func968;
618 974: fIdentFuncTable[I] := @func974;
619 978: fIdentFuncTable[I] := @func978;
620 981: fIdentFuncTable[I] := @func981;
621 985: fIdentFuncTable[I] := @func985;
622 986: fIdentFuncTable[I] := @func986;
623 988: fIdentFuncTable[I] := @func988;
624 1056: fIdentFuncTable[I] := @func1056;
625 1077: fIdentFuncTable[I] := @func1077;
626 1079: fIdentFuncTable[I] := @func1079;
627 1084: fIdentFuncTable[I] := @func1084;
628 1086: fIdentFuncTable[I] := @func1086;
629 1091: fIdentFuncTable[I] := @func1091;
630 1093: fIdentFuncTable[I] := @func1093;
631 1095: fIdentFuncTable[I] := @func1095;
632 1103: fIdentFuncTable[I] := @func1103;
633 1105: fIdentFuncTable[I] := @func1105;
634 1107: fIdentFuncTable[I] := @func1107;
635 1136: fIdentFuncTable[I] := @func1136;
636 1158: fIdentFuncTable[I] := @func1158;
637 1165: fIdentFuncTable[I] := @func1165;
638 1169: fIdentFuncTable[I] := @func1169;
639 1172: fIdentFuncTable[I] := @func1172;
640 1176: fIdentFuncTable[I] := @func1176;
641 1202: fIdentFuncTable[I] := @func1202;
642 1211: fIdentFuncTable[I] := @func1211;
643 1215: fIdentFuncTable[I] := @func1215;
644 1218: fIdentFuncTable[I] := @func1218;
645 1223: fIdentFuncTable[I] := @func1223;
646 1230: fIdentFuncTable[I] := @func1230;
647 1273: fIdentFuncTable[I] := @func1273;
648 1277: fIdentFuncTable[I] := @func1277;
649 1283: fIdentFuncTable[I] := @func1283;
650 1327: fIdentFuncTable[I] := @func1327;
651 1343: fIdentFuncTable[I] := @func1343;
652 1361: fIdentFuncTable[I] := @func1361;
653 1379: fIdentFuncTable[I] := @func1379;
654 1396: fIdentFuncTable[I] := @func1396;
655 1402: fIdentFuncTable[I] := @func1402;
656 1404: fIdentFuncTable[I] := @func1404;
657 1409: fIdentFuncTable[I] := @func1409;
658 1421: fIdentFuncTable[I] := @func1421;
659 1425: fIdentFuncTable[I] := @func1425;
660 1440: fIdentFuncTable[I] := @func1440;
661 1520: fIdentFuncTable[I] := @func1520;
662 1523: fIdentFuncTable[I] := @func1523;
663 1673: fIdentFuncTable[I] := @func1673;
664 1752: fIdentFuncTable[I] := @func1752;
665 1762: fIdentFuncTable[I] := @func1762;
666 1768: fIdentFuncTable[I] := @func1768;
667 2167: fIdentFuncTable[I] := @func2167;
668 else fIdentFuncTable[I] := @AltFunc;
669 end;
670 end;
671
KeyHashnull672 function TSynPerlSyn.KeyHash(ToHash: PChar): Integer;
673 begin
674 Result := 0;
675 while ToHash^ in ['%', '@', '$', '_', '0'..'9', 'a'..'z', 'A'..'Z'] do
676 begin
677 inc(Result, Integer(ToHash^));
678 inc(ToHash);
679 end;
680 fStringLen := ToHash - fToIdent;
681 end; { KeyHash }
682
KeyCompnull683 function TSynPerlSyn.KeyComp(const aKey: String): Boolean;
684 var
685 I: Integer;
686 Temp: PChar;
687 begin
688 Temp := fToIdent;
689 if Length(aKey) = fStringLen then
690 begin
691 Result := True;
692 for i := 1 to fStringLen do begin
693 if Temp^ <> aKey[i] then
694 begin
695 Result := False;
696 break;
697 end;
698 inc(Temp);
699 end;
700 end else Result := False;
701 end; { KeyComp }
702
Func109null703 function TSynPerlSyn.Func109: TtkTokenKind;
704 begin
705 if KeyComp('m') then Result := tkKey else Result := tkIdentifier;
706 end;
707
Func113null708 function TSynPerlSyn.Func113: TtkTokenKind;
709 begin
710 if KeyComp('q') then Result := tkKey else Result := tkIdentifier;
711 end;
712
TSynPerlSyn.Func196null713 function TSynPerlSyn.Func196: TtkTokenKind;
714 begin
715 if KeyComp('$NR') then Result := tkVariable else Result := tkIdentifier;
716 end;
717
Func201null718 function TSynPerlSyn.Func201: TtkTokenKind;
719 begin
720 if KeyComp('$RS') then Result := tkVariable else Result := tkIdentifier;
721 end;
722
TSynPerlSyn.Func204null723 function TSynPerlSyn.Func204: TtkTokenKind;
724 begin
725 if KeyComp('ge') then Result := tkOperator else Result := tkIdentifier;
726 end;
727
Func207null728 function TSynPerlSyn.Func207: TtkTokenKind;
729 begin
730 if KeyComp('lc') then Result := tkKey else
731 if KeyComp('if') then Result := tkKey else Result := tkIdentifier;
732 end;
733
Func209null734 function TSynPerlSyn.Func209: TtkTokenKind;
735 begin
736 if KeyComp('le') then Result := tkOperator else Result := tkIdentifier;
737 end;
738
Func211null739 function TSynPerlSyn.Func211: TtkTokenKind;
740 begin
741 if KeyComp('ne') then Result := tkOperator else
742 if KeyComp('do') then Result := tkKey else Result := tkIdentifier;
743 end;
744
TSynPerlSyn.Func214null745 function TSynPerlSyn.Func214: TtkTokenKind;
746 begin
747 if KeyComp('eq') then Result := tkOperator else Result := tkIdentifier;
748 end;
749
TSynPerlSyn.Func216null750 function TSynPerlSyn.Func216: TtkTokenKind;
751 begin
752 if KeyComp('uc') then Result := tkKey else Result := tkIdentifier;
753 end;
754
Func219null755 function TSynPerlSyn.Func219: TtkTokenKind;
756 begin
757 if KeyComp('gt') then Result := tkOperator else Result := tkIdentifier;
758 end;
759
Func221null760 function TSynPerlSyn.Func221: TtkTokenKind;
761 begin
762 if KeyComp('no') then Result := tkKey else Result := tkIdentifier;
763 end;
764
Func224null765 function TSynPerlSyn.Func224: TtkTokenKind;
766 begin
767 if KeyComp('lt') then Result := tkOperator else Result := tkIdentifier;
768 end;
769
TSynPerlSyn.Func225null770 function TSynPerlSyn.Func225: TtkTokenKind;
771 begin
772 if KeyComp('or') then Result := tkOperator else Result := tkIdentifier;
773 end;
774
TSynPerlSyn.Func226null775 function TSynPerlSyn.Func226: TtkTokenKind;
776 begin
777 if KeyComp('qq') then Result := tkKey else Result := tkIdentifier;
778 end;
779
TSynPerlSyn.Func230null780 function TSynPerlSyn.Func230: TtkTokenKind;
781 begin
782 if KeyComp('tr') then Result := tkKey else
783 if KeyComp('my') then Result := tkKey else Result := tkIdentifier;
784 end;
785
Func232null786 function TSynPerlSyn.Func232: TtkTokenKind;
787 begin
788 if KeyComp('qw') then Result := tkKey else Result := tkIdentifier;
789 end;
790
Func233null791 function TSynPerlSyn.Func233: TtkTokenKind;
792 begin
793 if KeyComp('qx') then Result := tkKey else Result := tkIdentifier;
794 end;
795
TSynPerlSyn.Func248null796 function TSynPerlSyn.Func248: TtkTokenKind;
797 begin
798 if KeyComp('$GID') then Result := tkVariable else Result := tkIdentifier;
799 end;
800
Func254null801 function TSynPerlSyn.Func254: TtkTokenKind;
802 begin
803 if KeyComp('$ARG') then Result := tkVariable else Result := tkIdentifier;
804 end;
805
Func255null806 function TSynPerlSyn.Func255: TtkTokenKind;
807 begin
808 if KeyComp('%INC') then Result := tkVariable else Result := tkIdentifier;
809 end;
810
Func257null811 function TSynPerlSyn.Func257: TtkTokenKind;
812 begin
813 if KeyComp('$PID') then Result := tkVariable else Result := tkIdentifier;
814 end;
815
TSynPerlSyn.Func262null816 function TSynPerlSyn.Func262: TtkTokenKind;
817 begin
818 if KeyComp('$UID') then Result := tkVariable else Result := tkIdentifier;
819 end;
820
TSynPerlSyn.Func263null821 function TSynPerlSyn.Func263: TtkTokenKind;
822 begin
823 if KeyComp('$SIG') then Result := tkVariable else Result := tkIdentifier;
824 end;
825
TSynPerlSyn.Func269null826 function TSynPerlSyn.Func269: TtkTokenKind;
827 begin
828 if KeyComp('$ENV') then Result := tkVariable else Result := tkIdentifier;
829 end;
830
Func280null831 function TSynPerlSyn.Func280: TtkTokenKind;
832 begin
833 if KeyComp('$ORS') then Result := tkVariable else Result := tkIdentifier;
834 end;
835
TSynPerlSyn.Func282null836 function TSynPerlSyn.Func282: TtkTokenKind;
837 begin
838 if KeyComp('@INC') then Result := tkVariable else Result := tkIdentifier;
839 end;
840
Func306null841 function TSynPerlSyn.Func306: TtkTokenKind;
842 begin
843 if KeyComp('die') then Result := tkKey else Result := tkIdentifier;
844 end;
845
Func307null846 function TSynPerlSyn.Func307: TtkTokenKind;
847 begin
848 if KeyComp('and') then Result := tkOperator else Result := tkIdentifier;
849 end;
850
Func310null851 function TSynPerlSyn.Func310: TtkTokenKind;
852 begin
853 if KeyComp('abs') then Result := tkKey else Result := tkIdentifier;
854 end;
855
TSynPerlSyn.Func314null856 function TSynPerlSyn.Func314: TtkTokenKind;
857 begin
858 if KeyComp('eof') then Result := tkKey else Result := tkIdentifier;
859 end;
860
Func317null861 function TSynPerlSyn.Func317: TtkTokenKind;
862 begin
863 if KeyComp('ref') then Result := tkKey else
864 if KeyComp('chr') then Result := tkKey else
865 if KeyComp('$EGID') then Result := tkVariable else Result := tkIdentifier;
866 end;
867
Func318null868 function TSynPerlSyn.Func318: TtkTokenKind;
869 begin
870 if KeyComp('vec') then Result := tkKey else
871 if KeyComp('map') then Result := tkKey else Result := tkIdentifier;
872 end;
873
Func320null874 function TSynPerlSyn.Func320: TtkTokenKind;
875 begin
876 if KeyComp('cmp') then Result := tkOperator else Result := tkIdentifier;
877 end;
878
Func322null879 function TSynPerlSyn.Func322: TtkTokenKind;
880 begin
881 if KeyComp('tie') then Result := tkKey else
882 if KeyComp('log') then Result := tkKey else Result := tkIdentifier;
883 end;
884
TSynPerlSyn.Func325null885 function TSynPerlSyn.Func325: TtkTokenKind;
886 begin
887 if KeyComp('hex') then Result := tkKey else
888 if KeyComp('ord') then Result := tkKey else
889 if KeyComp('cos') then Result := tkKey else Result := tkIdentifier;
890 end;
891
TSynPerlSyn.Func326null892 function TSynPerlSyn.Func326: TtkTokenKind;
893 begin
894 if KeyComp('oct') then Result := tkKey else Result := tkIdentifier;
895 end;
896
TSynPerlSyn.Func327null897 function TSynPerlSyn.Func327: TtkTokenKind;
898 begin
899 if KeyComp('for') then Result := tkKey else Result := tkIdentifier;
900 end;
901
TSynPerlSyn.Func330null902 function TSynPerlSyn.Func330: TtkTokenKind;
903 begin
904 if KeyComp('sin') then Result := tkKey else
905 if KeyComp('sub') then Result := tkKey else Result := tkIdentifier;
906 end;
907
Func331null908 function TSynPerlSyn.Func331: TtkTokenKind;
909 begin
910 if KeyComp('$EUID') then Result := tkVariable else
911 if KeyComp('int') then Result := tkKey else Result := tkIdentifier;
912 end;
913
Func333null914 function TSynPerlSyn.Func333: TtkTokenKind;
915 begin
916 if KeyComp('use') then Result := tkKey else
917 if KeyComp('exp') then Result := tkKey else Result := tkIdentifier;
918 end;
919
TSynPerlSyn.Func335null920 function TSynPerlSyn.Func335: TtkTokenKind;
921 begin
922 if KeyComp('pop') then Result := tkKey else Result := tkIdentifier;
923 end;
924
TSynPerlSyn.Func337null925 function TSynPerlSyn.Func337: TtkTokenKind;
926 begin
927 if KeyComp('not') then Result := tkOperator else Result := tkIdentifier;
928 end;
929
TSynPerlSyn.Func338null930 function TSynPerlSyn.Func338: TtkTokenKind;
931 begin
932 if KeyComp('pos') then Result := tkKey else Result := tkIdentifier;
933 end;
934
TSynPerlSyn.Func340null935 function TSynPerlSyn.Func340: TtkTokenKind;
936 begin
937 if KeyComp('$ARGV') then Result := tkVariable else Result := tkIdentifier;
938 end;
939
Func345null940 function TSynPerlSyn.Func345: TtkTokenKind;
941 begin
942 if KeyComp('xor') then Result := tkOperator else Result := tkIdentifier;
943 end;
944
TSynPerlSyn.Func346null945 function TSynPerlSyn.Func346: TtkTokenKind;
946 begin
947 if KeyComp('$OFMT') then Result := tkVariable else Result := tkIdentifier;
948 end;
949
TSynPerlSyn.Func368null950 function TSynPerlSyn.Func368: TtkTokenKind;
951 begin
952 if KeyComp('@ARGV') then Result := tkVariable else Result := tkIdentifier;
953 end;
954
TSynPerlSyn.Func401null955 function TSynPerlSyn.Func401: TtkTokenKind;
956 begin
957 if KeyComp('$MATCH') then Result := tkVariable else
958 if KeyComp('each') then Result := tkKey else Result := tkIdentifier;
959 end;
960
TSynPerlSyn.Func412null961 function TSynPerlSyn.Func412: TtkTokenKind;
962 begin
963 if KeyComp('read') then Result := tkKey else Result := tkIdentifier;
964 end;
965
TSynPerlSyn.Func413null966 function TSynPerlSyn.Func413: TtkTokenKind;
967 begin
968 if KeyComp('bind') then Result := tkKey else Result := tkIdentifier;
969 end;
970
TSynPerlSyn.Func415null971 function TSynPerlSyn.Func415: TtkTokenKind;
972 begin
973 if KeyComp('pack') then Result := tkKey else Result := tkIdentifier;
974 end;
975
TSynPerlSyn.Func419null976 function TSynPerlSyn.Func419: TtkTokenKind;
977 begin
978 if KeyComp('getc') then Result := tkKey else Result := tkIdentifier;
979 end;
980
Func420null981 function TSynPerlSyn.Func420: TtkTokenKind;
982 begin
983 if KeyComp('glob') then Result := tkKey else Result := tkIdentifier;
984 end;
985
Func421null986 function TSynPerlSyn.Func421: TtkTokenKind;
987 begin
988 if KeyComp('exec') then Result := tkKey else
989 if KeyComp('rand') then Result := tkKey else Result := tkIdentifier;
990 end;
991
TSynPerlSyn.Func424null992 function TSynPerlSyn.Func424: TtkTokenKind;
993 begin
994 if KeyComp('seek') then Result := tkKey else
995 if KeyComp('eval') then Result := tkKey else Result := tkIdentifier;
996 end;
997
TSynPerlSyn.Func425null998 function TSynPerlSyn.Func425: TtkTokenKind;
999 begin
1000 if KeyComp('else') then Result := tkKey else Result := tkIdentifier;
1001 end;
1002
TSynPerlSyn.Func426null1003 function TSynPerlSyn.Func426: TtkTokenKind;
1004 begin
1005 if KeyComp('chop') then Result := tkKey else
1006 if KeyComp('redo') then Result := tkKey else
1007 if KeyComp('send') then Result := tkKey else
1008 if KeyComp('$ERRNO') then Result := tkVariable else Result := tkIdentifier;
1009 end;
1010
Func428null1011 function TSynPerlSyn.Func428: TtkTokenKind;
1012 begin
1013 if KeyComp('kill') then Result := tkKey else Result := tkIdentifier;
1014 end;
1015
Func430null1016 function TSynPerlSyn.Func430: TtkTokenKind;
1017 begin
1018 if KeyComp('grep') then Result := tkKey else
1019 if KeyComp('pipe') then Result := tkKey else
1020 if KeyComp('link') then Result := tkKey else Result := tkIdentifier;
1021 end;
1022
Func431null1023 function TSynPerlSyn.Func431: TtkTokenKind;
1024 begin
1025 if KeyComp('time') then Result := tkKey else Result := tkIdentifier;
1026 end;
1027
Func432null1028 function TSynPerlSyn.Func432: TtkTokenKind;
1029 begin
1030 if KeyComp('recv') then Result := tkKey else
1031 if KeyComp('join') then Result := tkKey else Result := tkIdentifier;
1032 end;
1033
Func433null1034 function TSynPerlSyn.Func433: TtkTokenKind;
1035 begin
1036 if KeyComp('tell') then Result := tkKey else Result := tkIdentifier;
1037 end;
1038
TSynPerlSyn.Func434null1039 function TSynPerlSyn.Func434: TtkTokenKind;
1040 begin
1041 if KeyComp('open') then Result := tkKey else
1042 if KeyComp('fork') then Result := tkKey else Result := tkIdentifier;
1043 end;
1044
TSynPerlSyn.Func436null1045 function TSynPerlSyn.Func436: TtkTokenKind;
1046 begin
1047 if KeyComp('last') then Result := tkKey else Result := tkIdentifier;
1048 end;
1049
TSynPerlSyn.Func437null1050 function TSynPerlSyn.Func437: TtkTokenKind;
1051 begin
1052 if KeyComp('wait') then Result := tkKey else Result := tkIdentifier;
1053 end;
1054
Func438null1055 function TSynPerlSyn.Func438: TtkTokenKind;
1056 begin
1057 if KeyComp('dump') then Result := tkKey else Result := tkIdentifier;
1058 end;
1059
Func439null1060 function TSynPerlSyn.Func439: TtkTokenKind;
1061 begin
1062 if KeyComp('less') then Result := tkPragma else Result := tkIdentifier;
1063 end;
1064
TSynPerlSyn.Func440null1065 function TSynPerlSyn.Func440: TtkTokenKind;
1066 begin
1067 if KeyComp('warn') then Result := tkKey else Result := tkIdentifier;
1068 end;
1069
Func441null1070 function TSynPerlSyn.Func441: TtkTokenKind;
1071 begin
1072 if KeyComp('goto') then Result := tkKey else Result := tkIdentifier;
1073 end;
1074
Func442null1075 function TSynPerlSyn.Func442: TtkTokenKind;
1076 begin
1077 if KeyComp('exit') then Result := tkKey else Result := tkIdentifier;
1078 end;
1079
Func444null1080 function TSynPerlSyn.Func444: TtkTokenKind;
1081 begin
1082 if KeyComp('vars') then Result := tkPragma else
1083 if KeyComp('keys') then Result := tkKey else
1084 if KeyComp('stat') then Result := tkKey else Result := tkIdentifier;
1085 end;
1086
TSynPerlSyn.Func445null1087 function TSynPerlSyn.Func445: TtkTokenKind;
1088 begin
1089 if KeyComp('subs') then Result := tkPragma else Result := tkIdentifier;
1090 end;
1091
TSynPerlSyn.Func447null1092 function TSynPerlSyn.Func447: TtkTokenKind;
1093 begin
1094 if KeyComp('next') then Result := tkKey else Result := tkIdentifier;
1095 end;
1096
TSynPerlSyn.Func448null1097 function TSynPerlSyn.Func448: TtkTokenKind;
1098 begin
1099 if KeyComp('push') then Result := tkKey else Result := tkIdentifier;
1100 end;
1101
TSynPerlSyn.Func456null1102 function TSynPerlSyn.Func456: TtkTokenKind;
1103 begin
1104 if KeyComp('sort') then Result := tkKey else Result := tkIdentifier;
1105 end;
1106
TSynPerlSyn.Func458null1107 function TSynPerlSyn.Func458: TtkTokenKind;
1108 begin
1109 if KeyComp('sqrt') then Result := tkKey else Result := tkIdentifier;
1110 end;
1111
TSynPerlSyn.Func470null1112 function TSynPerlSyn.Func470: TtkTokenKind;
1113 begin
1114 if KeyComp('atan2') then Result := tkKey else Result := tkIdentifier;
1115 end;
1116
Func477null1117 function TSynPerlSyn.Func477: TtkTokenKind;
1118 begin
1119 if KeyComp('$PERLDB') then Result := tkVariable else Result := tkIdentifier;
1120 end;
1121
TSynPerlSyn.Func502null1122 function TSynPerlSyn.Func502: TtkTokenKind;
1123 begin
1124 if KeyComp('$SUBSEP') then Result := tkVariable else Result := tkIdentifier;
1125 end;
1126
TSynPerlSyn.Func522null1127 function TSynPerlSyn.Func522: TtkTokenKind;
1128 begin
1129 if KeyComp('chdir') then Result := tkKey else Result := tkIdentifier;
1130 end;
1131
TSynPerlSyn.Func523null1132 function TSynPerlSyn.Func523: TtkTokenKind;
1133 begin
1134 if KeyComp('local') then Result := tkKey else
1135 if KeyComp('chmod') then Result := tkKey else Result := tkIdentifier;
1136 end;
1137
TSynPerlSyn.Func525null1138 function TSynPerlSyn.Func525: TtkTokenKind;
1139 begin
1140 if KeyComp('alarm') then Result := tkKey else Result := tkIdentifier;
1141 end;
1142
Func527null1143 function TSynPerlSyn.Func527: TtkTokenKind;
1144 begin
1145 if KeyComp('flock') then Result := tkKey else Result := tkIdentifier;
1146 end;
1147
Func530null1148 function TSynPerlSyn.Func530: TtkTokenKind;
1149 begin
1150 if KeyComp('undef') then Result := tkKey else Result := tkIdentifier;
1151 end;
1152
Func531null1153 function TSynPerlSyn.Func531: TtkTokenKind;
1154 begin
1155 if KeyComp('elsif') then Result := tkKey else Result := tkIdentifier;
1156 end;
1157
TSynPerlSyn.Func534null1158 function TSynPerlSyn.Func534: TtkTokenKind;
1159 begin
1160 if KeyComp('close') then Result := tkKey else Result := tkIdentifier;
1161 end;
1162
TSynPerlSyn.Func535null1163 function TSynPerlSyn.Func535: TtkTokenKind;
1164 begin
1165 if KeyComp('mkdir') then Result := tkKey else
1166 if KeyComp('fcntl') then Result := tkKey else
1167 if KeyComp('chomp') then Result := tkKey else Result := tkIdentifier;
1168 end;
1169
TSynPerlSyn.Func536null1170 function TSynPerlSyn.Func536: TtkTokenKind;
1171 begin
1172 if KeyComp('index') then Result := tkKey else
1173 if KeyComp('srand') then Result := tkKey else Result := tkIdentifier;
1174 end;
1175
Func537null1176 function TSynPerlSyn.Func537: TtkTokenKind;
1177 begin
1178 if KeyComp('sleep') then Result := tkKey else
1179 if KeyComp('while') then Result := tkKey else
1180 if KeyComp('bless') then Result := tkKey else Result := tkIdentifier;
1181 end;
1182
Func539null1183 function TSynPerlSyn.Func539: TtkTokenKind;
1184 begin
1185 if KeyComp('ioctl') then Result := tkKey else Result := tkIdentifier;
1186 end;
1187
Func542null1188 function TSynPerlSyn.Func542: TtkTokenKind;
1189 begin
1190 if KeyComp('shift') then Result := tkKey else
1191 if KeyComp('rmdir') then Result := tkKey else Result := tkIdentifier;
1192 end;
1193
Func543null1194 function TSynPerlSyn.Func543: TtkTokenKind;
1195 begin
1196 if KeyComp('chown') then Result := tkKey else Result := tkIdentifier;
1197 end;
1198
TSynPerlSyn.Func545null1199 function TSynPerlSyn.Func545: TtkTokenKind;
1200 begin
1201 if KeyComp('umask') then Result := tkKey else Result := tkIdentifier;
1202 end;
1203
TSynPerlSyn.Func546null1204 function TSynPerlSyn.Func546: TtkTokenKind;
1205 begin
1206 if KeyComp('times') then Result := tkKey else Result := tkIdentifier;
1207 end;
1208
TSynPerlSyn.Func547null1209 function TSynPerlSyn.Func547: TtkTokenKind;
1210 begin
1211 if KeyComp('reset') then Result := tkKey else Result := tkIdentifier;
1212 end;
1213
Func548null1214 function TSynPerlSyn.Func548: TtkTokenKind;
1215 begin
1216 if KeyComp('semop') then Result := tkKey else
1217 if KeyComp('utime') then Result := tkKey else Result := tkIdentifier;
1218 end;
1219
Func549null1220 function TSynPerlSyn.Func549: TtkTokenKind;
1221 begin
1222 if KeyComp('untie') then Result := tkKey else Result := tkIdentifier;
1223 end;
1224
Func552null1225 function TSynPerlSyn.Func552: TtkTokenKind;
1226 begin
1227 if KeyComp('lstat') then Result := tkKey else Result := tkIdentifier;
1228 end;
1229
TSynPerlSyn.Func555null1230 function TSynPerlSyn.Func555: TtkTokenKind;
1231 begin
1232 if KeyComp('write') then Result := tkKey else Result := tkIdentifier;
1233 end;
1234
TSynPerlSyn.Func556null1235 function TSynPerlSyn.Func556: TtkTokenKind;
1236 begin
1237 if KeyComp('split') then Result := tkKey else Result := tkIdentifier;
1238 end;
1239
TSynPerlSyn.Func557null1240 function TSynPerlSyn.Func557: TtkTokenKind;
1241 begin
1242 if KeyComp('print') then Result := tkKey else Result := tkIdentifier;
1243 end;
1244
Func562null1245 function TSynPerlSyn.Func562: TtkTokenKind;
1246 begin
1247 if KeyComp('crypt') then Result := tkKey else Result := tkIdentifier;
1248 end;
1249
TSynPerlSyn.Func569null1250 function TSynPerlSyn.Func569: TtkTokenKind;
1251 begin
1252 if KeyComp('study') then Result := tkKey else Result := tkIdentifier;
1253 end;
1254
TSynPerlSyn.Func570null1255 function TSynPerlSyn.Func570: TtkTokenKind;
1256 begin
1257 if KeyComp('$WARNING') then Result := tkVariable else Result := tkIdentifier;
1258 end;
1259
TSynPerlSyn.Func622null1260 function TSynPerlSyn.Func622: TtkTokenKind;
1261 begin
1262 if KeyComp('$BASETIME') then Result := tkVariable else Result := tkIdentifier;
1263 end;
1264
TSynPerlSyn.Func624null1265 function TSynPerlSyn.Func624: TtkTokenKind;
1266 begin
1267 if KeyComp('locale') then Result := tkPragma else
1268 if KeyComp('accept') then Result := tkKey else Result := tkIdentifier;
1269 end;
1270
Func627null1271 function TSynPerlSyn.Func627: TtkTokenKind;
1272 begin
1273 if KeyComp('caller') then Result := tkKey else
1274 if KeyComp('delete') then Result := tkKey else Result := tkIdentifier;
1275 end;
1276
Func630null1277 function TSynPerlSyn.Func630: TtkTokenKind;
1278 begin
1279 if KeyComp('scalar') then Result := tkKey else Result := tkIdentifier;
1280 end;
1281
TSynPerlSyn.Func632null1282 function TSynPerlSyn.Func632: TtkTokenKind;
1283 begin
1284 if KeyComp('rename') then Result := tkKey else
1285 if KeyComp('$PREMATCH') then Result := tkVariable else Result := tkIdentifier;
1286 end;
1287
Func637null1288 function TSynPerlSyn.Func637: TtkTokenKind;
1289 begin
1290 if KeyComp('fileno') then Result := tkKey else Result := tkIdentifier;
1291 end;
1292
Func640null1293 function TSynPerlSyn.Func640: TtkTokenKind;
1294 begin
1295 if KeyComp('splice') then Result := tkKey else
1296 if KeyComp('select') then Result := tkKey else Result := tkIdentifier;
1297 end;
1298
Func642null1299 function TSynPerlSyn.Func642: TtkTokenKind;
1300 begin
1301 if KeyComp('length') then Result := tkKey else
1302 if KeyComp('unpack') then Result := tkKey else Result := tkIdentifier;
1303 end;
1304
TSynPerlSyn.Func643null1305 function TSynPerlSyn.Func643: TtkTokenKind;
1306 begin
1307 if KeyComp('gmtime') then Result := tkKey else Result := tkIdentifier;
1308 end;
1309
TSynPerlSyn.Func645null1310 function TSynPerlSyn.Func645: TtkTokenKind;
1311 begin
1312 if KeyComp('semget') then Result := tkKey else Result := tkIdentifier;
1313 end;
1314
Func647null1315 function TSynPerlSyn.Func647: TtkTokenKind;
1316 begin
1317 if KeyComp('msgget') then Result := tkKey else Result := tkIdentifier;
1318 end;
1319
Func648null1320 function TSynPerlSyn.Func648: TtkTokenKind;
1321 begin
1322 if KeyComp('shmget') then Result := tkKey else
1323 if KeyComp('semctl') then Result := tkKey else Result := tkIdentifier;
1324 end;
1325
Func649null1326 function TSynPerlSyn.Func649: TtkTokenKind;
1327 begin
1328 if KeyComp('socket') then Result := tkKey else
1329 if KeyComp('format') then Result := tkKey else Result := tkIdentifier;
1330 end;
1331
Func650null1332 function TSynPerlSyn.Func650: TtkTokenKind;
1333 begin
1334 if KeyComp('rindex') then Result := tkKey else
1335 if KeyComp('msgctl') then Result := tkKey else Result := tkIdentifier;
1336 end;
1337
Func651null1338 function TSynPerlSyn.Func651: TtkTokenKind;
1339 begin
1340 if KeyComp('shmctl') then Result := tkKey else Result := tkIdentifier;
1341 end;
1342
Func652null1343 function TSynPerlSyn.Func652: TtkTokenKind;
1344 begin
1345 if KeyComp('msgsnd') then Result := tkKey else Result := tkIdentifier;
1346 end;
1347
TSynPerlSyn.Func655null1348 function TSynPerlSyn.Func655: TtkTokenKind;
1349 begin
1350 if KeyComp('listen') then Result := tkKey else
1351 if KeyComp('chroot') then Result := tkKey else Result := tkIdentifier;
1352 end;
1353
TSynPerlSyn.Func656null1354 function TSynPerlSyn.Func656: TtkTokenKind;
1355 begin
1356 if KeyComp('values') then Result := tkKey else Result := tkIdentifier;
1357 end;
1358
TSynPerlSyn.Func657null1359 function TSynPerlSyn.Func657: TtkTokenKind;
1360 begin
1361 if KeyComp('unlink') then Result := tkKey else Result := tkIdentifier;
1362 end;
1363
Func658null1364 function TSynPerlSyn.Func658: TtkTokenKind;
1365 begin
1366 if KeyComp('msgrcv') then Result := tkKey else Result := tkIdentifier;
1367 end;
1368
TSynPerlSyn.Func665null1369 function TSynPerlSyn.Func665: TtkTokenKind;
1370 begin
1371 if KeyComp('strict') then Result := tkPragma else Result := tkIdentifier;
1372 end;
1373
TSynPerlSyn.Func666null1374 function TSynPerlSyn.Func666: TtkTokenKind;
1375 begin
1376 if KeyComp('unless') then Result := tkKey else Result := tkIdentifier;
1377 end;
1378
TSynPerlSyn.Func667null1379 function TSynPerlSyn.Func667: TtkTokenKind;
1380 begin
1381 if KeyComp('import') then Result := tkKey else Result := tkIdentifier;
1382 end;
1383
Func672null1384 function TSynPerlSyn.Func672: TtkTokenKind;
1385 begin
1386 if KeyComp('return') then Result := tkKey else
1387 if KeyComp('exists') then Result := tkKey else Result := tkIdentifier;
1388 end;
1389
Func675null1390 function TSynPerlSyn.Func675: TtkTokenKind;
1391 begin
1392 if KeyComp('substr') then Result := tkKey else Result := tkIdentifier;
1393 end;
1394
TSynPerlSyn.Func677null1395 function TSynPerlSyn.Func677: TtkTokenKind;
1396 begin
1397 if KeyComp('system') then Result := tkKey else Result := tkIdentifier;
1398 end;
1399
TSynPerlSyn.Func687null1400 function TSynPerlSyn.Func687: TtkTokenKind;
1401 begin
1402 if KeyComp('$OS_ERROR') then Result := tkVariable else Result := tkIdentifier;
1403 end;
1404
TSynPerlSyn.Func688null1405 function TSynPerlSyn.Func688: TtkTokenKind;
1406 begin
1407 if KeyComp('$DEBUGGING') then Result := tkVariable else Result := tkIdentifier;
1408 end;
1409
TSynPerlSyn.Func716null1410 function TSynPerlSyn.Func716: TtkTokenKind;
1411 begin
1412 if KeyComp('package') then Result := tkKey else Result := tkIdentifier;
1413 end;
1414
TSynPerlSyn.Func719null1415 function TSynPerlSyn.Func719: TtkTokenKind;
1416 begin
1417 if KeyComp('defined') then Result := tkKey else Result := tkIdentifier;
1418 end;
1419
TSynPerlSyn.Func727null1420 function TSynPerlSyn.Func727: TtkTokenKind;
1421 begin
1422 if KeyComp('$POSTMATCH') then Result := tkVariable else Result := tkIdentifier;
1423 end;
1424
TSynPerlSyn.Func728null1425 function TSynPerlSyn.Func728: TtkTokenKind;
1426 begin
1427 if KeyComp('foreach') then Result := tkKey else Result := tkIdentifier;
1428 end;
1429
TSynPerlSyn.Func731null1430 function TSynPerlSyn.Func731: TtkTokenKind;
1431 begin
1432 if KeyComp('readdir') then Result := tkKey else Result := tkIdentifier;
1433 end;
1434
TSynPerlSyn.Func734null1435 function TSynPerlSyn.Func734: TtkTokenKind;
1436 begin
1437 if KeyComp('binmode') then Result := tkKey else Result := tkIdentifier;
1438 end;
1439
Func740null1440 function TSynPerlSyn.Func740: TtkTokenKind;
1441 begin
1442 if KeyComp('shmread') then Result := tkKey else Result := tkIdentifier;
1443 end;
1444
Func741null1445 function TSynPerlSyn.Func741: TtkTokenKind;
1446 begin
1447 if KeyComp('dbmopen') then Result := tkKey else Result := tkIdentifier;
1448 end;
1449
TSynPerlSyn.Func743null1450 function TSynPerlSyn.Func743: TtkTokenKind;
1451 begin
1452 if KeyComp('seekdir') then Result := tkKey else Result := tkIdentifier;
1453 end;
1454
Func746null1455 function TSynPerlSyn.Func746: TtkTokenKind;
1456 begin
1457 if KeyComp('connect') then Result := tkKey else Result := tkIdentifier;
1458 end;
1459
TSynPerlSyn.Func749null1460 function TSynPerlSyn.Func749: TtkTokenKind;
1461 begin
1462 if KeyComp('getppid') then Result := tkKey else Result := tkIdentifier;
1463 end;
1464
Func750null1465 function TSynPerlSyn.Func750: TtkTokenKind;
1466 begin
1467 if KeyComp('integer') then Result := tkPragma else Result := tkIdentifier;
1468 end;
1469
Func752null1470 function TSynPerlSyn.Func752: TtkTokenKind;
1471 begin
1472 if KeyComp('telldir') then Result := tkKey else Result := tkIdentifier;
1473 end;
1474
TSynPerlSyn.Func753null1475 function TSynPerlSyn.Func753: TtkTokenKind;
1476 begin
1477 if KeyComp('opendir') then Result := tkKey else Result := tkIdentifier;
1478 end;
1479
TSynPerlSyn.Func754null1480 function TSynPerlSyn.Func754: TtkTokenKind;
1481 begin
1482 if KeyComp('waitpid') then Result := tkKey else Result := tkIdentifier;
1483 end;
1484
Func759null1485 function TSynPerlSyn.Func759: TtkTokenKind;
1486 begin
1487 if KeyComp('lcfirst') then Result := tkKey else Result := tkIdentifier;
1488 end;
1489
Func761null1490 function TSynPerlSyn.Func761: TtkTokenKind;
1491 begin
1492 if KeyComp('getpgrp') then Result := tkKey else Result := tkIdentifier;
1493 end;
1494
Func762null1495 function TSynPerlSyn.Func762: TtkTokenKind;
1496 begin
1497 if KeyComp('sigtrap') then Result := tkPragma else Result := tkIdentifier;
1498 end;
1499
Func763null1500 function TSynPerlSyn.Func763: TtkTokenKind;
1501 begin
1502 if KeyComp('sysread') then Result := tkKey else
1503 if KeyComp('syscall') then Result := tkKey else Result := tkIdentifier;
1504 end;
1505
TSynPerlSyn.Func764null1506 function TSynPerlSyn.Func764: TtkTokenKind;
1507 begin
1508 if KeyComp('reverse') then Result := tkKey else Result := tkIdentifier;
1509 end;
1510
TSynPerlSyn.Func765null1511 function TSynPerlSyn.Func765: TtkTokenKind;
1512 begin
1513 if KeyComp('require') then Result := tkKey else Result := tkIdentifier;
1514 end;
1515
Func768null1516 function TSynPerlSyn.Func768: TtkTokenKind;
1517 begin
1518 if KeyComp('ucfirst') then Result := tkKey else Result := tkIdentifier;
1519 end;
1520
Func769null1521 function TSynPerlSyn.Func769: TtkTokenKind;
1522 begin
1523 if KeyComp('unshift') then Result := tkKey else Result := tkIdentifier;
1524 end;
1525
Func773null1526 function TSynPerlSyn.Func773: TtkTokenKind;
1527 begin
1528 if KeyComp('setpgrp') then Result := tkKey else Result := tkIdentifier;
1529 end;
1530
Func774null1531 function TSynPerlSyn.Func774: TtkTokenKind;
1532 begin
1533 if KeyComp('sprintf') then Result := tkKey else Result := tkIdentifier;
1534 end;
1535
TSynPerlSyn.Func775null1536 function TSynPerlSyn.Func775: TtkTokenKind;
1537 begin
1538 if KeyComp('symlink') then Result := tkKey else Result := tkIdentifier;
1539 end;
1540
TSynPerlSyn.Func815null1541 function TSynPerlSyn.Func815: TtkTokenKind;
1542 begin
1543 if KeyComp('$PROCESS_ID') then Result := tkVariable else Result := tkIdentifier;
1544 end;
1545
TSynPerlSyn.Func821null1546 function TSynPerlSyn.Func821: TtkTokenKind;
1547 begin
1548 if KeyComp('$EVAL_ERROR') then Result := tkVariable else Result := tkIdentifier;
1549 end;
1550
TSynPerlSyn.Func841null1551 function TSynPerlSyn.Func841: TtkTokenKind;
1552 begin
1553 if KeyComp('dbmclose') then Result := tkKey else Result := tkIdentifier;
1554 end;
1555
TSynPerlSyn.Func842null1556 function TSynPerlSyn.Func842: TtkTokenKind;
1557 begin
1558 if KeyComp('readlink') then Result := tkKey else Result := tkIdentifier;
1559 end;
1560
Func845null1561 function TSynPerlSyn.Func845: TtkTokenKind;
1562 begin
1563 if KeyComp('getgrgid') then Result := tkKey else Result := tkIdentifier;
1564 end;
1565
TSynPerlSyn.Func853null1566 function TSynPerlSyn.Func853: TtkTokenKind;
1567 begin
1568 if KeyComp('getgrnam') then Result := tkKey else
1569 if KeyComp('closedir') then Result := tkKey else Result := tkIdentifier;
1570 end;
1571
TSynPerlSyn.Func855null1572 function TSynPerlSyn.Func855: TtkTokenKind;
1573 begin
1574 if KeyComp('endgrent') then Result := tkKey else Result := tkIdentifier;
1575 end;
1576
Func857null1577 function TSynPerlSyn.Func857: TtkTokenKind;
1578 begin
1579 if KeyComp('getlogin') then Result := tkKey else Result := tkIdentifier;
1580 end;
1581
Func860null1582 function TSynPerlSyn.Func860: TtkTokenKind;
1583 begin
1584 if KeyComp('formline') then Result := tkKey else Result := tkIdentifier;
1585 end;
1586
TSynPerlSyn.Func864null1587 function TSynPerlSyn.Func864: TtkTokenKind;
1588 begin
1589 if KeyComp('getgrent') then Result := tkKey else Result := tkIdentifier;
1590 end;
1591
Func867null1592 function TSynPerlSyn.Func867: TtkTokenKind;
1593 begin
1594 if KeyComp('getpwnam') then Result := tkKey else Result := tkIdentifier;
1595 end;
1596
Func868null1597 function TSynPerlSyn.Func868: TtkTokenKind;
1598 begin
1599 if KeyComp('$ACCUMULATOR') then Result := tkVariable else Result := tkIdentifier;
1600 end;
1601
Func869null1602 function TSynPerlSyn.Func869: TtkTokenKind;
1603 begin
1604 if KeyComp('endpwent') then Result := tkKey else Result := tkIdentifier;
1605 end;
1606
Func870null1607 function TSynPerlSyn.Func870: TtkTokenKind;
1608 begin
1609 if KeyComp('truncate') then Result := tkKey else Result := tkIdentifier;
1610 end;
1611
Func873null1612 function TSynPerlSyn.Func873: TtkTokenKind;
1613 begin
1614 if KeyComp('getpwuid') then Result := tkKey else Result := tkIdentifier;
1615 end;
1616
TSynPerlSyn.Func874null1617 function TSynPerlSyn.Func874: TtkTokenKind;
1618 begin
1619 if KeyComp('constant') then Result := tkPragma else Result := tkIdentifier;
1620 end;
1621
TSynPerlSyn.Func876null1622 function TSynPerlSyn.Func876: TtkTokenKind;
1623 begin
1624 if KeyComp('setgrent') then Result := tkKey else Result := tkIdentifier;
1625 end;
1626
TSynPerlSyn.Func877null1627 function TSynPerlSyn.Func877: TtkTokenKind;
1628 begin
1629 if KeyComp('$FORMAT_NAME') then Result := tkVariable else Result := tkIdentifier;
1630 end;
1631
Func878null1632 function TSynPerlSyn.Func878: TtkTokenKind;
1633 begin
1634 if KeyComp('getpwent') then Result := tkKey else Result := tkIdentifier;
1635 end;
1636
Func881null1637 function TSynPerlSyn.Func881: TtkTokenKind;
1638 begin
1639 if KeyComp('$CHILD_ERROR') then Result := tkVariable else Result := tkIdentifier;
1640 end;
1641
Func883null1642 function TSynPerlSyn.Func883: TtkTokenKind;
1643 begin
1644 if KeyComp('shmwrite') then Result := tkKey else Result := tkIdentifier;
1645 end;
1646
TSynPerlSyn.Func890null1647 function TSynPerlSyn.Func890: TtkTokenKind;
1648 begin
1649 if KeyComp('setpwent') then Result := tkKey else Result := tkIdentifier;
1650 end;
1651
Func892null1652 function TSynPerlSyn.Func892: TtkTokenKind;
1653 begin
1654 if KeyComp('shutdown') then Result := tkKey else Result := tkIdentifier;
1655 end;
1656
TSynPerlSyn.Func906null1657 function TSynPerlSyn.Func906: TtkTokenKind;
1658 begin
1659 if KeyComp('syswrite') then Result := tkKey else Result := tkIdentifier;
1660 end;
1661
Func933null1662 function TSynPerlSyn.Func933: TtkTokenKind;
1663 begin
1664 if KeyComp('$INPLACE_EDIT') then Result := tkVariable else Result := tkIdentifier;
1665 end;
1666
TSynPerlSyn.Func954null1667 function TSynPerlSyn.Func954: TtkTokenKind;
1668 begin
1669 if KeyComp('localtime') then Result := tkKey else Result := tkIdentifier;
1670 end;
1671
Func956null1672 function TSynPerlSyn.Func956: TtkTokenKind;
1673 begin
1674 if KeyComp('$PROGRAM_NAME') then Result := tkVariable else Result := tkIdentifier;
1675 end;
1676
TSynPerlSyn.Func965null1677 function TSynPerlSyn.Func965: TtkTokenKind;
1678 begin
1679 if KeyComp('endnetent') then Result := tkKey else Result := tkIdentifier;
1680 end;
1681
Func968null1682 function TSynPerlSyn.Func968: TtkTokenKind;
1683 begin
1684 if KeyComp('rewinddir') then Result := tkKey else Result := tkIdentifier;
1685 end;
1686
TSynPerlSyn.Func974null1687 function TSynPerlSyn.Func974: TtkTokenKind;
1688 begin
1689 if KeyComp('getnetent') then Result := tkKey else Result := tkIdentifier;
1690 end;
1691
Func978null1692 function TSynPerlSyn.Func978: TtkTokenKind;
1693 begin
1694 if KeyComp('$REAL_USER_ID') then Result := tkVariable else Result := tkIdentifier;
1695 end;
1696
Func981null1697 function TSynPerlSyn.Func981: TtkTokenKind;
1698 begin
1699 if KeyComp('quotemeta') then Result := tkKey else Result := tkIdentifier;
1700 end;
1701
TSynPerlSyn.Func985null1702 function TSynPerlSyn.Func985: TtkTokenKind;
1703 begin
1704 if KeyComp('wantarray') then Result := tkKey else Result := tkIdentifier;
1705 end;
1706
TSynPerlSyn.Func986null1707 function TSynPerlSyn.Func986: TtkTokenKind;
1708 begin
1709 if KeyComp('setnetent') then Result := tkKey else Result := tkIdentifier;
1710 end;
1711
Func988null1712 function TSynPerlSyn.Func988: TtkTokenKind;
1713 begin
1714 if KeyComp('$PERL_VERSION') then Result := tkVariable else Result := tkIdentifier;
1715 end;
1716
TSynPerlSyn.Func1056null1717 function TSynPerlSyn.Func1056: TtkTokenKind;
1718 begin
1719 if KeyComp('$REAL_GROUP_ID') then Result := tkVariable else Result := tkIdentifier;
1720 end;
1721
Func1077null1722 function TSynPerlSyn.Func1077: TtkTokenKind;
1723 begin
1724 if KeyComp('socketpair') then Result := tkKey else Result := tkIdentifier;
1725 end;
1726
TSynPerlSyn.Func1079null1727 function TSynPerlSyn.Func1079: TtkTokenKind;
1728 begin
1729 if KeyComp('$SYSTEM_FD_MAX') then Result := tkVariable else Result := tkIdentifier;
1730 end;
1731
Func1084null1732 function TSynPerlSyn.Func1084: TtkTokenKind;
1733 begin
1734 if KeyComp('endhostent') then Result := tkKey else Result := tkIdentifier;
1735 end;
1736
TSynPerlSyn.Func1086null1737 function TSynPerlSyn.Func1086: TtkTokenKind;
1738 begin
1739 if KeyComp('endservent') then Result := tkKey else Result := tkIdentifier;
1740 end;
1741
Func1091null1742 function TSynPerlSyn.Func1091: TtkTokenKind;
1743 begin
1744 if KeyComp('getsockopt') then Result := tkKey else Result := tkIdentifier;
1745 end;
1746
TSynPerlSyn.Func1093null1747 function TSynPerlSyn.Func1093: TtkTokenKind;
1748 begin
1749 if KeyComp('gethostent') then Result := tkKey else Result := tkIdentifier;
1750 end;
1751
Func1095null1752 function TSynPerlSyn.Func1095: TtkTokenKind;
1753 begin
1754 if KeyComp('getservent') then Result := tkKey else Result := tkIdentifier;
1755 end;
1756
TSynPerlSyn.Func1103null1757 function TSynPerlSyn.Func1103: TtkTokenKind;
1758 begin
1759 if KeyComp('setsockopt') then Result := tkKey else Result := tkIdentifier;
1760 end;
1761
TSynPerlSyn.Func1105null1762 function TSynPerlSyn.Func1105: TtkTokenKind;
1763 begin
1764 if KeyComp('sethostent') then Result := tkKey else Result := tkIdentifier;
1765 end;
1766
Func1107null1767 function TSynPerlSyn.Func1107: TtkTokenKind;
1768 begin
1769 if KeyComp('setservent') then Result := tkKey else Result := tkIdentifier;
1770 end;
1771
TSynPerlSyn.Func1136null1772 function TSynPerlSyn.Func1136: TtkTokenKind;
1773 begin
1774 if KeyComp('$LIST_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1775 end;
1776
TSynPerlSyn.Func1158null1777 function TSynPerlSyn.Func1158: TtkTokenKind;
1778 begin
1779 if KeyComp('$EXECUTABLE_NAME') then Result := tkVariable else Result := tkIdentifier;
1780 end;
1781
Func1165null1782 function TSynPerlSyn.Func1165: TtkTokenKind;
1783 begin
1784 if KeyComp('getpeername') then Result := tkKey else Result := tkIdentifier;
1785 end;
1786
TSynPerlSyn.Func1169null1787 function TSynPerlSyn.Func1169: TtkTokenKind;
1788 begin
1789 if KeyComp('getsockname') then Result := tkKey else Result := tkIdentifier;
1790 end;
1791
Func1172null1792 function TSynPerlSyn.Func1172: TtkTokenKind;
1793 begin
1794 if KeyComp('$FORMAT_FORMFEED') then Result := tkVariable else Result := tkIdentifier;
1795 end;
1796
Func1176null1797 function TSynPerlSyn.Func1176: TtkTokenKind;
1798 begin
1799 if KeyComp('diagnostics') then Result := tkPragma else Result := tkIdentifier;
1800 end;
1801
TSynPerlSyn.Func1202null1802 function TSynPerlSyn.Func1202: TtkTokenKind;
1803 begin
1804 if KeyComp('endprotoent') then Result := tkKey else Result := tkIdentifier;
1805 end;
1806
TSynPerlSyn.Func1211null1807 function TSynPerlSyn.Func1211: TtkTokenKind;
1808 begin
1809 if KeyComp('getprotoent') then Result := tkKey else Result := tkIdentifier;
1810 end;
1811
TSynPerlSyn.Func1215null1812 function TSynPerlSyn.Func1215: TtkTokenKind;
1813 begin
1814 if KeyComp('$FORMAT_TOP_NAME') then Result := tkVariable else Result := tkIdentifier;
1815 end;
1816
TSynPerlSyn.Func1218null1817 function TSynPerlSyn.Func1218: TtkTokenKind;
1818 begin
1819 if KeyComp('getpriority') then Result := tkKey else Result := tkIdentifier;
1820 end;
1821
Func1223null1822 function TSynPerlSyn.Func1223: TtkTokenKind;
1823 begin
1824 if KeyComp('setprotoent') then Result := tkKey else Result := tkIdentifier;
1825 end;
1826
Func1230null1827 function TSynPerlSyn.Func1230: TtkTokenKind;
1828 begin
1829 if KeyComp('setpriority') then Result := tkKey else Result := tkIdentifier;
1830 end;
1831
TSynPerlSyn.Func1273null1832 function TSynPerlSyn.Func1273: TtkTokenKind;
1833 begin
1834 if KeyComp('$LAST_PAREN_MATCH') then Result := tkVariable else Result := tkIdentifier;
1835 end;
1836
TSynPerlSyn.Func1277null1837 function TSynPerlSyn.Func1277: TtkTokenKind;
1838 begin
1839 if KeyComp('getnetbyaddr') then Result := tkKey else Result := tkIdentifier;
1840 end;
1841
TSynPerlSyn.Func1283null1842 function TSynPerlSyn.Func1283: TtkTokenKind;
1843 begin
1844 if KeyComp('getnetbyname') then Result := tkKey else Result := tkIdentifier;
1845 end;
1846
Func1327null1847 function TSynPerlSyn.Func1327: TtkTokenKind;
1848 begin
1849 if KeyComp('$OUTPUT_AUTOFLUSH') then Result := tkVariable else Result := tkIdentifier;
1850 end;
1851
TSynPerlSyn.Func1343null1852 function TSynPerlSyn.Func1343: TtkTokenKind;
1853 begin
1854 if KeyComp('$EFFECTIVE_USER_ID') then Result := tkVariable else Result := tkIdentifier;
1855 end;
1856
TSynPerlSyn.Func1361null1857 function TSynPerlSyn.Func1361: TtkTokenKind;
1858 begin
1859 if KeyComp('$FORMAT_LINES_LEFT') then Result := tkVariable else Result := tkIdentifier;
1860 end;
1861
TSynPerlSyn.Func1379null1862 function TSynPerlSyn.Func1379: TtkTokenKind;
1863 begin
1864 if KeyComp('$INPUT_LINE_NUMBER') then Result := tkVariable else Result := tkIdentifier;
1865 end;
1866
Func1396null1867 function TSynPerlSyn.Func1396: TtkTokenKind;
1868 begin
1869 if KeyComp('gethostbyaddr') then Result := tkKey else Result := tkIdentifier;
1870 end;
1871
TSynPerlSyn.Func1402null1872 function TSynPerlSyn.Func1402: TtkTokenKind;
1873 begin
1874 if KeyComp('gethostbyname') then Result := tkKey else Result := tkIdentifier;
1875 end;
1876
Func1404null1877 function TSynPerlSyn.Func1404: TtkTokenKind;
1878 begin
1879 if KeyComp('getservbyname') then Result := tkKey else Result := tkIdentifier;
1880 end;
1881
TSynPerlSyn.Func1409null1882 function TSynPerlSyn.Func1409: TtkTokenKind;
1883 begin
1884 if KeyComp('$MULTILINE_MATCHING') then Result := tkVariable else Result := tkIdentifier;
1885 end;
1886
Func1421null1887 function TSynPerlSyn.Func1421: TtkTokenKind;
1888 begin
1889 if KeyComp('$EFFECTIVE_GROUP_ID') then Result := tkVariable else Result := tkIdentifier;
1890 end;
1891
Func1425null1892 function TSynPerlSyn.Func1425: TtkTokenKind;
1893 begin
1894 if KeyComp('$FORMAT_PAGE_NUMBER') then Result := tkVariable else Result := tkIdentifier;
1895 end;
1896
Func1440null1897 function TSynPerlSyn.Func1440: TtkTokenKind;
1898 begin
1899 if KeyComp('getservbyport') then Result := tkKey else Result := tkIdentifier;
1900 end;
1901
Func1520null1902 function TSynPerlSyn.Func1520: TtkTokenKind;
1903 begin
1904 if KeyComp('getprotobyname') then Result := tkKey else Result := tkIdentifier;
1905 end;
1906
TSynPerlSyn.Func1523null1907 function TSynPerlSyn.Func1523: TtkTokenKind;
1908 begin
1909 if KeyComp('$SUBSCRIPT_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1910 end;
1911
TSynPerlSyn.Func1673null1912 function TSynPerlSyn.Func1673: TtkTokenKind;
1913 begin
1914 if KeyComp('$FORMAT_LINES_PER_PAGE') then Result := tkVariable else Result := tkIdentifier;
1915 end;
1916
TSynPerlSyn.Func1752null1917 function TSynPerlSyn.Func1752: TtkTokenKind;
1918 begin
1919 if KeyComp('getprotobynumber') then Result := tkKey else Result := tkIdentifier;
1920 end;
1921
Func1762null1922 function TSynPerlSyn.Func1762: TtkTokenKind;
1923 begin
1924 if KeyComp('$INPUT_RECORD_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1925 end;
1926
TSynPerlSyn.Func1768null1927 function TSynPerlSyn.Func1768: TtkTokenKind;
1928 begin
1929 if KeyComp('$OUTPUT_FIELD_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1930 end;
1931
TSynPerlSyn.Func2167null1932 function TSynPerlSyn.Func2167: TtkTokenKind;
1933 begin
1934 if KeyComp('$FORMAT_LINE_BREAK_CHARACTERS') then Result := tkVariable else Result := tkIdentifier;
1935 end;
1936
TSynPerlSyn.AltFuncnull1937 function TSynPerlSyn.AltFunc: TtkTokenKind;
1938 begin
1939 Result := tkIdentifier;
1940 end;
1941
TSynPerlSyn.IdentKindnull1942 function TSynPerlSyn.IdentKind(MayBe: PChar): TtkTokenKind;
1943 var
1944 HashKey: Integer;
1945 begin
1946 fToIdent := MayBe;
1947 HashKey := KeyHash(MayBe);
1948 if HashKey < 2168 then
1949 Result := fIdentFuncTable[HashKey]()
1950 else
1951 Result := tkIdentifier;
1952 end;
1953
1954 procedure TSynPerlSyn.MakeMethodTables;
1955 var
1956 I: Char;
1957 begin
1958 for I := #0 to #255 do
1959 case I of
1960 '&': fProcTable[I] := @AndSymbolProc;
1961 #13: fProcTable[I] := @CRProc;
1962 ':': fProcTable[I] := @ColonProc;
1963 '#': fProcTable[I] := @CommentProc;
1964 '=': fProcTable[I] := @EqualProc;
1965 '>': fProcTable[I] := @GreaterProc;
1966 '%', '@', '$', 'A'..'Z', 'a'..'z', '_':
1967 fProcTable[I] := @IdentProc;
1968 #10: fProcTable[I] := @LFProc;
1969 '<': fProcTable[I] := @LowerProc;
1970 '-': fProcTable[I] := @MinusProc;
1971 '!': fProcTable[I] := @NotSymbolProc;
1972 #0: fProcTable[I] := @NullProc;
1973 '0'..'9', '.': fProcTable[I] := @NumberProc;
1974 '|': fProcTable[I] := @OrSymbolProc;
1975 '+': fProcTable[I] := @PlusProc;
1976 '/': fProcTable[I] := @SlashProc;
1977 #1..#9, #11, #12, #14..#32: fProcTable[I] := @SpaceProc;
1978 '*': fProcTable[I] := @StarProc;
1979 #34: fProcTable[I] := @StringInterpProc;
1980 #39: fProcTable[I] := @StringLiteralProc;
1981 '^': fProcTable[I] := @XOrSymbolProc;
1982 '(', ')', '[', ']', '\', '{', '}', ',', ';', '?', '~':
1983 fProcTable[I] := @SymbolProc;
1984 else
1985 fProcTable[I] := @UnknownProc;
1986 end;
1987 end;
1988
1989 constructor TSynPerlSyn.Create(AOwner: TComponent);
1990 begin
1991 inherited Create(AOwner);
1992 fCommentAttri := TSynHighlighterAttributes.Create(@SYNS_AttrComment, SYNS_XML_AttrComment);
1993 fCommentAttri.Style:= [fsItalic];
1994 AddAttribute(fCommentAttri);
1995 fIdentifierAttri := TSynHighlighterAttributes.Create(@SYNS_AttrIdentifier, SYNS_XML_AttrIdentifier);
1996 AddAttribute(fIdentifierAttri);
1997 fInvalidAttri := TSynHighlighterAttributes.Create(@SYNS_AttrIllegalChar, SYNS_XML_AttrIllegalChar);
1998 AddAttribute(fInvalidAttri);
1999 fKeyAttri := TSynHighlighterAttributes.Create(@SYNS_AttrReservedWord, SYNS_XML_AttrReservedWord);
2000 fKeyAttri.Style:= [fsBold];
2001 AddAttribute(fKeyAttri);
2002 fNumberAttri := TSynHighlighterAttributes.Create(@SYNS_AttrNumber, SYNS_XML_AttrNumber);
2003 AddAttribute(fNumberAttri);
2004 fOperatorAttri := TSynHighlighterAttributes.Create(@SYNS_AttrOperator, SYNS_XML_AttrOperator);
2005 AddAttribute(fOperatorAttri);
2006 fPragmaAttri := TSynHighlighterAttributes.Create(@SYNS_AttrPragma, SYNS_XML_AttrPragma);
2007 fPragmaAttri.Style := [fsBold];
2008 AddAttribute(fPragmaAttri);
2009 fSpaceAttri := TSynHighlighterAttributes.Create(@SYNS_AttrSpace, SYNS_XML_AttrSpace);
2010 fSpaceAttri.Foreground := clWindow;
2011 AddAttribute(fSpaceAttri);
2012 fStringAttri := TSynHighlighterAttributes.Create(@SYNS_AttrString, SYNS_XML_AttrString);
2013 AddAttribute(fStringAttri);
2014 fSymbolAttri := TSynHighlighterAttributes.Create(@SYNS_AttrSymbol, SYNS_XML_AttrSymbol);
2015 AddAttribute(fSymbolAttri);
2016 fVariableAttri := TSynHighlighterAttributes.Create(@SYNS_AttrVariable, SYNS_XML_AttrVariable);
2017 fVariableAttri.Style := [fsBold];
2018 AddAttribute(fVariableAttri);
2019 SetAttributesOnChange(@DefHighlightChange);
2020 InitIdent;
2021 MakeMethodTables;
2022 fDefaultFilter := SYNS_FilterPerl;
2023 end; { Create }
2024
2025 procedure TSynPerlSyn.SetLine(const NewValue: String;
2026 LineNumber:Integer);
2027 begin
2028 inherited;
2029 fLine := PChar(NewValue);
2030 Run := 0;
2031 fLineNumber := LineNumber;
2032 Next;
2033 end; { SetLine }
2034
2035 procedure TSynPerlSyn.AndSymbolProc;
2036 begin
2037 case FLine[Run + 1] of
2038 '=': {bit and assign}
2039 begin
2040 inc(Run, 2);
2041 fTokenID := tkSymbol;
2042 end;
2043 '&':
2044 begin
2045 if FLine[Run + 2] = '=' then {logical and assign}
2046 inc(Run, 3)
2047 else {logical and}
2048 inc(Run, 2);
2049 fTokenID := tkSymbol;
2050 end;
2051 else {bit and}
2052 begin
2053 inc(Run);
2054 fTokenID := tkSymbol;
2055 end;
2056 end;
2057 end;
2058
2059 procedure TSynPerlSyn.CRProc;
2060 begin
2061 fTokenID := tkSpace;
2062 Case FLine[Run + 1] of
2063 #10: inc(Run, 2);
2064 else inc(Run);
2065 end;
2066 end;
2067
2068 procedure TSynPerlSyn.ColonProc;
2069 begin
2070 Case FLine[Run + 1] of
2071 ':': {double colon}
2072 begin
2073 inc(Run, 2);
2074 fTokenID := tkSymbol;
2075 end;
2076 else {colon}
2077 begin
2078 inc(Run);
2079 fTokenID := tkSymbol;
2080 end;
2081 end;
2082 end;
2083
2084 procedure TSynPerlSyn.CommentProc;
2085 begin
2086 fTokenID := tkComment;
2087 repeat
2088 case FLine[Run] of
2089 #0, #10, #13: break;
2090 end;
2091 inc(Run);
2092 until FLine[Run] = #0;
2093 end;
2094
2095 procedure TSynPerlSyn.EqualProc;
2096 begin
2097 case FLine[Run + 1] of
2098 '=': {logical equal}
2099 begin
2100 inc(Run, 2);
2101 fTokenID := tkSymbol;
2102 end;
2103 '>': {digraph}
2104 begin
2105 inc(Run, 2);
2106 fTokenID := tkSymbol;
2107 end;
2108 '~': {bind scalar to pattern}
2109 begin
2110 inc(Run, 2);
2111 fTokenID := tkSymbol;
2112 end;
2113 else {assign}
2114 begin
2115 inc(Run);
2116 fTokenID := tkSymbol;
2117 end;
2118 end;
2119 end;
2120
2121 procedure TSynPerlSyn.GreaterProc;
2122 begin
2123 Case FLine[Run + 1] of
2124 '=': {greater than or equal to}
2125 begin
2126 inc(Run, 2);
2127 fTokenID := tkSymbol;
2128 end;
2129 '>':
2130 begin
2131 if FLine[Run + 2] = '=' then {shift right assign}
2132 inc(Run, 3)
2133 else {shift right}
2134 inc(Run, 2);
2135 fTokenID := tkSymbol;
2136 end;
2137 else {greater than}
2138 begin
2139 inc(Run);
2140 fTokenID := tkSymbol;
2141 end;
2142 end;
2143 end;
2144
2145 procedure TSynPerlSyn.IdentProc;
2146 begin
2147 Case FLine[Run] of
2148 '$':
2149 begin
2150 Case FLine[Run + 1] of
2151 '!'..'+', '-'..'@', '['..']', '_', '`', '|', '~':
2152 begin {predefined variables}
2153 inc(Run, 2);
2154 fTokenID := tkVariable;
2155 exit;
2156 end;
2157 '^':
2158 begin
2159 Case FLine[Run + 2] of
2160 'A', 'D', 'F', 'I', 'L', 'P', 'T', 'W', 'X':
2161 begin {predefined variables}
2162 inc(Run, 3);
2163 fTokenID := tkVariable;
2164 exit;
2165 end;
2166 #0, #10, #13: {predefined variables}
2167 begin
2168 inc(Run, 2);
2169 fTokenID := tkVariable;
2170 exit;
2171 end;
2172 end;
2173 end;
2174 end;
2175 end;
2176 '%':
2177 begin
2178 Case FLine[Run + 1] of
2179 '=': {mod assign}
2180 begin
2181 inc(Run, 2);
2182 fTokenID := tkSymbol;
2183 exit;
2184 end;
2185 #0, #10, #13: {mod}
2186 begin
2187 inc(Run);
2188 fTokenID := tkSymbol;
2189 exit;
2190 end;
2191 end;
2192 end;
2193 'x':
2194 begin
2195 Case FLine[Run + 1] of
2196 '=': {repetition assign}
2197 begin
2198 inc(Run, 2);
2199 fTokenID := tkSymbol;
2200 exit;
2201 end;
2202 #0, #10, #13: {repetition}
2203 begin
2204 inc(Run);
2205 fTokenID := tkSymbol;
2206 exit;
2207 end;
2208 end;
2209 end;
2210 end;
2211 {regular identifier}
2212 fTokenID := IdentKind((fLine + Run));
2213 inc(Run, fStringLen);
2214 while Identifiers[fLine[Run]] do inc(Run);
2215 end;
2216
2217 procedure TSynPerlSyn.LFProc;
2218 begin
2219 fTokenID := tkSpace;
2220 inc(Run);
2221 end;
2222
2223 procedure TSynPerlSyn.LowerProc;
2224 begin
2225 case FLine[Run + 1] of
2226 '=':
2227 begin
2228 if FLine[Run + 2] = '>' then {compare - less than, equal, greater}
2229 inc(Run, 3)
2230 else {less than or equal to}
2231 inc(Run, 2);
2232 fTokenID := tkSymbol;
2233 end;
2234 '<':
2235 begin
2236 if FLine[Run + 2] = '=' then {shift left assign}
2237 inc(Run, 3)
2238 else {shift left}
2239 inc(Run, 2);
2240 fTokenID := tkSymbol;
2241 end;
2242 else {less than}
2243 begin
2244 inc(Run);
2245 fTokenID := tkSymbol;
2246 end;
2247 end;
2248 end;
2249
2250 procedure TSynPerlSyn.MinusProc;
2251 begin
2252 case FLine[Run + 1] of
2253 '=': {subtract assign}
2254 begin
2255 inc(Run, 2);
2256 fTokenID := tkSymbol;
2257 end;
2258 '-': {decrement}
2259 begin
2260 inc(Run, 2);
2261 fTokenID := tkSymbol;
2262 end;
2263 '>': {arrow}
2264 begin
2265 inc(Run, 2);
2266 fTokenID := tkSymbol;
2267 end;
2268 else {subtract}
2269 begin
2270 inc(Run);
2271 fTokenID := tkSymbol;
2272 end;
2273 end;
2274 end;
2275
2276 procedure TSynPerlSyn.NotSymbolProc;
2277 begin
2278 case FLine[Run + 1] of
2279 '~': {logical negated bind like =~}
2280 begin
2281 inc(Run, 2);
2282 fTokenID := tkSymbol;
2283 end;
2284 '=': {not equal}
2285 begin
2286 inc(Run, 2);
2287 fTokenID := tkSymbol;
2288 end;
2289 else {not}
2290 begin
2291 inc(Run);
2292 fTokenID := tkSymbol;
2293 end;
2294 end;
2295 end;
2296
2297 procedure TSynPerlSyn.NullProc;
2298 begin
2299 fTokenID := tkNull;
2300 end;
2301
2302 procedure TSynPerlSyn.NumberProc;
2303 begin
2304 if FLine[Run] = '.' then
2305 begin
2306 case FLine[Run + 1] of
2307 '.':
2308 begin
2309 inc(Run, 2);
2310 if FLine[Run] = '.' then {sed range}
2311 inc(Run);
2312
2313 fTokenID := tkSymbol; {range}
2314 exit;
2315 end;
2316 '=':
2317 begin
2318 inc(Run, 2);
2319 fTokenID := tkSymbol; {concatenation assign}
2320 exit;
2321 end;
2322 'a'..'z', 'A'..'Z', '_':
2323 begin
2324 fTokenID := tkSymbol; {concatenation}
2325 inc(Run);
2326 exit;
2327 end;
2328 end;
2329 end;
2330
2331 fTokenID := tkNumber;
2332
2333 if (FLine[Run] = '0') and (FLine[Run+1] in ['x', 'X'])then
2334 begin
2335 inc(Run, 2);
2336 while FLine[Run] in ['0'..'9', 'A'..'F', 'a'..'f'] do inc(Run);
2337 exit;
2338 end;
2339
2340 inc(Run);
2341 while FLine[Run] in ['0'..'9'] do inc(Run);
2342 if (FLine[Run]='.') and not(fLine[Run+1]='.') then begin
2343 inc(Run);
2344 while FLine[Run] in ['0'..'9'] do inc(Run);
2345 end;
2346 if (FLine[Run]='e') or (fLine[Run]='E') then begin
2347 inc(Run);
2348 if (FLine[Run]='+') or (fLine[Run]='-') then inc(Run);
2349 while FLine[Run] in ['0'..'9'] do inc(Run);
2350 end;
2351 end;
2352
2353 procedure TSynPerlSyn.OrSymbolProc;
2354 begin
2355 case FLine[Run + 1] of
2356 '=': {bit or assign}
2357 begin
2358 inc(Run, 2);
2359 fTokenID := tkSymbol;
2360 end;
2361 '|':
2362 begin
2363 if FLine[Run + 2] = '=' then {logical or assign}
2364 inc(Run, 3)
2365 else {logical or}
2366 inc(Run, 2);
2367 fTokenID := tkSymbol;
2368 end;
2369 else {bit or}
2370 begin
2371 inc(Run);
2372 fTokenID := tkSymbol;
2373 end;
2374 end;
2375 end;
2376
2377 procedure TSynPerlSyn.PlusProc;
2378 begin
2379 case FLine[Run + 1] of
2380 '=': {add assign}
2381 begin
2382 inc(Run, 2);
2383 fTokenID := tkSymbol;
2384 end;
2385 '+': {increment}
2386 begin
2387 inc(Run, 2);
2388 fTokenID := tkSymbol;
2389 end;
2390 else {add}
2391 begin
2392 inc(Run);
2393 fTokenID := tkSymbol;
2394 end;
2395 end;
2396 end;
2397
2398 procedure TSynPerlSyn.SlashProc;
2399 begin
2400 case FLine[Run + 1] of
2401 '=': {division assign}
2402 begin
2403 inc(Run, 2);
2404 fTokenID := tkSymbol;
2405 end;
2406 else {division}
2407 begin
2408 inc(Run);
2409 fTokenID := tkSymbol;
2410 end;
2411 end;
2412 end;
2413
2414 procedure TSynPerlSyn.SpaceProc;
2415 begin
2416 inc(Run);
2417 fTokenID := tkSpace;
2418 while FLine[Run] in [#1..#9, #11, #12, #14..#32] do inc(Run);
2419 end;
2420
2421 procedure TSynPerlSyn.StarProc;
2422 begin
2423 case FLine[Run + 1] of
2424 '=': {multiply assign}
2425 begin
2426 inc(Run, 2);
2427 fTokenID := tkSymbol;
2428 end;
2429 '*':
2430 begin
2431 if FLine[Run + 2] = '=' then {exponentiation assign}
2432 inc(Run, 3)
2433 else {exponentiation}
2434 inc(Run, 2);
2435 fTokenID := tkSymbol;
2436 end;
2437 else {multiply}
2438 begin
2439 inc(Run);
2440 fTokenID := tkSymbol;
2441 end;
2442 end;
2443 end;
2444
2445 procedure TSynPerlSyn.StringInterpProc;
2446 begin
2447 fTokenID := tkString;
2448 if (FLine[Run + 1] = #34) and (FLine[Run + 2] = #34) then inc(Run, 2);
2449 repeat
2450 case FLine[Run] of
2451 #0, #10, #13: break;
2452 #92:
2453 { backslash quote not the ending one }
2454 if FLine[Run + 1] = #34 then inc(Run);
2455 end;
2456 inc(Run);
2457 until FLine[Run] = #34;
2458 if FLine[Run] <> #0 then inc(Run);
2459 end;
2460
2461 procedure TSynPerlSyn.StringLiteralProc;
2462 begin
2463 fTokenID := tkString;
2464 repeat
2465 case FLine[Run] of
2466 #0, #10, #13: break;
2467 end;
2468 inc(Run);
2469 until FLine[Run] = #39;
2470 if FLine[Run] <> #0 then inc(Run);
2471 end;
2472
2473 procedure TSynPerlSyn.SymbolProc;
2474 begin
2475 inc(Run);
2476 fTokenId := tkSymbol;
2477 end;
2478
2479 procedure TSynPerlSyn.XOrSymbolProc;
2480 begin
2481 Case FLine[Run + 1] of
2482 '=': {xor assign}
2483 begin
2484 inc(Run, 2);
2485 fTokenID := tkSymbol;
2486 end;
2487 else {xor}
2488 begin
2489 inc(Run);
2490 fTokenID := tkSymbol;
2491 end;
2492 end;
2493 end;
2494
2495 procedure TSynPerlSyn.UnknownProc;
2496 begin
2497 {$IFDEF SYN_MBCSSUPPORT}
2498 if FLine[Run] in LeadBytes then
2499 Inc(Run,2)
2500 else
2501 {$ENDIF}
2502 inc(Run);
2503 while (fLine[Run] in [#128..#191]) OR // continued utf8 subcode
2504 ((fLine[Run]<>#0) and (fProcTable[fLine[Run]] = @UnknownProc)) do inc(Run);
2505 fTokenID := tkUnknown;
2506 end;
2507
2508 procedure TSynPerlSyn.Next;
2509 begin
2510 fTokenPos := Run;
2511 fProcTable[fLine[Run]]();
2512 end;
2513
TSynPerlSyn.GetDefaultAttributenull2514 function TSynPerlSyn.GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
2515 begin
2516 case Index of
2517 SYN_ATTR_COMMENT: Result := fCommentAttri;
2518 SYN_ATTR_IDENTIFIER: Result := fIdentifierAttri;
2519 SYN_ATTR_KEYWORD: Result := fKeyAttri;
2520 SYN_ATTR_STRING: Result := fStringAttri;
2521 SYN_ATTR_WHITESPACE: Result := fSpaceAttri;
2522 SYN_ATTR_SYMBOL: Result := fSymbolAttri;
2523 SYN_ATTR_NUMBER: Result := fNumberAttri;
2524 SYN_ATTR_VARIABLE: Result := fVariableAttri;
2525 else
2526 Result := nil;
2527 end;
2528 end;
2529
GetEolnull2530 function TSynPerlSyn.GetEol: Boolean;
2531 begin
2532 Result := fTokenID = tkNull;
2533 end;
2534
TSynPerlSyn.GetTokennull2535 function TSynPerlSyn.GetToken: string;
2536 var
2537 Len: LongInt;
2538 begin
2539 Result := '';
2540 Len := Run - fTokenPos;
2541 SetString(Result, (FLine + fTokenPos), Len);
2542 end;
2543
2544 procedure TSynPerlSyn.GetTokenEx(out TokenStart: PChar;
2545 out TokenLength: integer);
2546 begin
2547 TokenLength:=Run-fTokenPos;
2548 TokenStart:=FLine + fTokenPos;
2549 end;
2550
GetTokenIDnull2551 function TSynPerlSyn.GetTokenID: TtkTokenKind;
2552 begin
2553 Result := fTokenId;
2554 end;
2555
TSynPerlSyn.GetTokenAttributenull2556 function TSynPerlSyn.GetTokenAttribute: TSynHighlighterAttributes;
2557 begin
2558 case fTokenID of
2559 tkComment: Result := fCommentAttri;
2560 tkIdentifier: Result := fIdentifierAttri;
2561 tkKey: Result := fKeyAttri;
2562 tkNumber: Result := fNumberAttri;
2563 tkOperator: Result := fOperatorAttri;
2564 tkPragma: Result := fPragmaAttri;
2565 tkSpace: Result := fSpaceAttri;
2566 tkString: Result := fStringAttri;
2567 tkSymbol: Result := fSymbolAttri;
2568 tkUnknown: Result := fInvalidAttri;
2569 tkVariable: Result := fVariableAttri;
2570 else Result := nil;
2571 end;
2572 end;
2573
GetTokenKindnull2574 function TSynPerlSyn.GetTokenKind: integer;
2575 begin
2576 Result := Ord(fTokenId);
2577 end;
2578
TSynPerlSyn.GetTokenPosnull2579 function TSynPerlSyn.GetTokenPos: Integer;
2580 begin
2581 Result := fTokenPos;
2582 end;
2583
GetIdentCharsnull2584 function TSynPerlSyn.GetIdentChars: TSynIdentChars;
2585 begin
2586 Result := ['%', '@', '$', '_', '0'..'9', 'a'..'z', 'A'..'Z'] + TSynSpecialChars;
2587 end;
2588
TSynPerlSyn.GetLanguageNamenull2589 class function TSynPerlSyn.GetLanguageName: string;
2590 begin
2591 Result := SYNS_LangPerl;
2592 end;
2593
2594 initialization
2595 MakeIdentTable;
2596 RegisterPlaceableHighlighter(TSynPerlSyn);
2597
2598 end.
2599
2600