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: synhighlighterperl.pas 46388 2014-09-30 23:57:55Z martin $
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;
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 uses
400 SynEditStrConst;
401
402 var
403 Identifiers: array[#0..#255] of ByteBool;
404 // mHashTable: array[#0..#255] of Integer;
405
406 procedure MakeIdentTable;
407 var
408 I: Char;
409 begin
410 for I := #0 to #255 do
411 begin
412 Case I of
413 '_', '0'..'9', 'a'..'z', 'A'..'Z': Identifiers[I] := True;
414 else Identifiers[I] := False;
415 end;
416 {Case I in['%', '@', '$', '_', 'a'..'z', 'A'..'Z'] of
417 True:
418 begin
419 if (I > #64) and (I < #91) then mHashTable[I] := Ord(I) - 64 else
420 if (I > #96) then mHashTable[I] := Ord(I) - 95;
421 end;
422 else mHashTable[I] := 0;
423 end;}
424 end;
425 end;
426
427 procedure TSynPerlSyn.InitIdent;
428 var
429 I: Integer;
430 begin
431 for I := 0 to 2167 do
432 Case I of
433 109: fIdentFuncTable[I] := @Func109;
434 113: fIdentFuncTable[I] :=@func113;
435 196: fIdentFuncTable[I] :=@func196;
436 201: fIdentFuncTable[I] :=@func201;
437 204: fIdentFuncTable[I] :=@func204;
438 207: fIdentFuncTable[I] :=@func207;
439 209: fIdentFuncTable[I] :=@func209;
440 211: fIdentFuncTable[I] :=@func211;
441 214: fIdentFuncTable[I] :=@func214;
442 216: fIdentFuncTable[I] :=@func216;
443 219: fIdentFuncTable[I] :=@func219;
444 221: fIdentFuncTable[I] :=@func221;
445 224: fIdentFuncTable[I] :=@func224;
446 225: fIdentFuncTable[I] :=@func225;
447 226: fIdentFuncTable[I] :=@func226;
448 230: fIdentFuncTable[I] :=@func230;
449 232: fIdentFuncTable[I] :=@func232;
450 233: fIdentFuncTable[I] :=@func233;
451 248: fIdentFuncTable[I] :=@func248;
452 254: fIdentFuncTable[I] :=@func254;
453 255: fIdentFuncTable[I] :=@func255;
454 257: fIdentFuncTable[I] :=@func257;
455 262: fIdentFuncTable[I] :=@func262;
456 263: fIdentFuncTable[I] :=@func263;
457 269: fIdentFuncTable[I] :=@func269;
458 280: fIdentFuncTable[I] :=@func280;
459 282: fIdentFuncTable[I] :=@func282;
460 306: fIdentFuncTable[I] :=@func306;
461 307: fIdentFuncTable[I] :=@func307;
462 310: fIdentFuncTable[I] :=@func310;
463 314: fIdentFuncTable[I] :=@func314;
464 317: fIdentFuncTable[I] :=@func317;
465 318: fIdentFuncTable[I] :=@func318;
466 320: fIdentFuncTable[I] :=@func320;
467 322: fIdentFuncTable[I] :=@func322;
468 325: fIdentFuncTable[I] :=@func325;
469 326: fIdentFuncTable[I] :=@func326;
470 327: fIdentFuncTable[I] :=@func327;
471 330: fIdentFuncTable[I] :=@func330;
472 331: fIdentFuncTable[I] :=@func331;
473 333: fIdentFuncTable[I] :=@func333;
474 335: fIdentFuncTable[I] :=@func335;
475 337: fIdentFuncTable[I] :=@func337;
476 338: fIdentFuncTable[I] :=@func338;
477 340: fIdentFuncTable[I] :=@func340;
478 345: fIdentFuncTable[I] :=@func345;
479 346: fIdentFuncTable[I] :=@func346;
480 368: fIdentFuncTable[I] :=@func368;
481 401: fIdentFuncTable[I] :=@func401;
482 412: fIdentFuncTable[I] :=@func412;
483 413: fIdentFuncTable[I] :=@func413;
484 415: fIdentFuncTable[I] :=@func415;
485 419: fIdentFuncTable[I] :=@func419;
486 420: fIdentFuncTable[I] :=@func420;
487 421: fIdentFuncTable[I] :=@func421;
488 424: fIdentFuncTable[I] :=@func424;
489 425: fIdentFuncTable[I] :=@func425;
490 426: fIdentFuncTable[I] :=@func426;
491 428: fIdentFuncTable[I] :=@func428;
492 430: fIdentFuncTable[I] :=@func430;
493 431: fIdentFuncTable[I] :=@func431;
494 432: fIdentFuncTable[I] :=@func432;
495 433: fIdentFuncTable[I] :=@func433;
496 434: fIdentFuncTable[I] :=@func434;
497 436: fIdentFuncTable[I] :=@func436;
498 437: fIdentFuncTable[I] :=@func437;
499 438: fIdentFuncTable[I] :=@func438;
500 439: fIdentFuncTable[I] :=@func439;
501 440: fIdentFuncTable[I] :=@func440;
502 441: fIdentFuncTable[I] :=@func441;
503 442: fIdentFuncTable[I] :=@func442;
504 444: fIdentFuncTable[I] :=@func444;
505 445: fIdentFuncTable[I] :=@func445;
506 447: fIdentFuncTable[I] :=@func447;
507 448: fIdentFuncTable[I] :=@func448;
508 456: fIdentFuncTable[I] :=@func456;
509 458: fIdentFuncTable[I] :=@func458;
510 470: fIdentFuncTable[I] :=@func470;
511 477: fIdentFuncTable[I] :=@func477;
512 502: fIdentFuncTable[I] :=@func502;
513 522: fIdentFuncTable[I] :=@func522;
514 523: fIdentFuncTable[I] :=@func523;
515 525: fIdentFuncTable[I] :=@func525;
516 527: fIdentFuncTable[I] :=@func527;
517 530: fIdentFuncTable[I] :=@func530;
518 531: fIdentFuncTable[I] :=@func531;
519 534: fIdentFuncTable[I] :=@func534;
520 535: fIdentFuncTable[I] :=@func535;
521 536: fIdentFuncTable[I] :=@func536;
522 537: fIdentFuncTable[I] :=@func537;
523 539: fIdentFuncTable[I] :=@func539;
524 542: fIdentFuncTable[I] :=@func542;
525 543: fIdentFuncTable[I] :=@func543;
526 545: fIdentFuncTable[I] :=@func545;
527 546: fIdentFuncTable[I] :=@func546;
528 547: fIdentFuncTable[I] :=@func547;
529 548: fIdentFuncTable[I] :=@func548;
530 549: fIdentFuncTable[I] :=@func549;
531 552: fIdentFuncTable[I] :=@func552;
532 555: fIdentFuncTable[I] :=@func555;
533 556: fIdentFuncTable[I] :=@func556;
534 557: fIdentFuncTable[I] :=@func557;
535 562: fIdentFuncTable[I] :=@func562;
536 569: fIdentFuncTable[I] :=@func569;
537 570: fIdentFuncTable[I] :=@func570;
538 622: fIdentFuncTable[I] :=@func622;
539 624: fIdentFuncTable[I] :=@func624;
540 627: fIdentFuncTable[I] :=@func627;
541 630: fIdentFuncTable[I] :=@func630;
542 632: fIdentFuncTable[I] :=@func632;
543 637: fIdentFuncTable[I] :=@func637;
544 640: fIdentFuncTable[I] :=@func640;
545 642: fIdentFuncTable[I] :=@func642;
546 643: fIdentFuncTable[I] :=@func643;
547 645: fIdentFuncTable[I] :=@func645;
548 647: fIdentFuncTable[I] :=@func647;
549 648: fIdentFuncTable[I] :=@func648;
550 649: fIdentFuncTable[I] :=@func649;
551 650: fIdentFuncTable[I] :=@func650;
552 651: fIdentFuncTable[I] :=@func651;
553 652: fIdentFuncTable[I] :=@func652;
554 655: fIdentFuncTable[I] := @func655;
555 656: fIdentFuncTable[I] := @func656;
556 657: fIdentFuncTable[I] := @func657;
557 658: fIdentFuncTable[I] := @func658;
558 665: fIdentFuncTable[I] := @func665;
559 666: fIdentFuncTable[I] := @func666;
560 667: fIdentFuncTable[I] := @func667;
561 672: fIdentFuncTable[I] := @func672;
562 675: fIdentFuncTable[I] := @func675;
563 677: fIdentFuncTable[I] := @func677;
564 687: fIdentFuncTable[I] := @func687;
565 688: fIdentFuncTable[I] := @func688;
566 716: fIdentFuncTable[I] := @func716;
567 719: fIdentFuncTable[I] := @func719;
568 727: fIdentFuncTable[I] := @func727;
569 728: fIdentFuncTable[I] := @func728;
570 731: fIdentFuncTable[I] := @func731;
571 734: fIdentFuncTable[I] := @func734;
572 740: fIdentFuncTable[I] := @func740;
573 741: fIdentFuncTable[I] := @func741;
574 743: fIdentFuncTable[I] := @func743;
575 746: fIdentFuncTable[I] := @func746;
576 749: fIdentFuncTable[I] := @func749;
577 750: fIdentFuncTable[I] := @func750;
578 752: fIdentFuncTable[I] := @func752;
579 753: fIdentFuncTable[I] := @func753;
580 754: fIdentFuncTable[I] := @func754;
581 759: fIdentFuncTable[I] := @func759;
582 761: fIdentFuncTable[I] := @func761;
583 762: fIdentFuncTable[I] := @func762;
584 763: fIdentFuncTable[I] := @func763;
585 764: fIdentFuncTable[I] := @func764;
586 765: fIdentFuncTable[I] := @func765;
587 768: fIdentFuncTable[I] := @func768;
588 769: fIdentFuncTable[I] := @func769;
589 773: fIdentFuncTable[I] := @func773;
590 774: fIdentFuncTable[I] := @func774;
591 775: fIdentFuncTable[I] := @func775;
592 815: fIdentFuncTable[I] := @func815;
593 821: fIdentFuncTable[I] := @func821;
594 841: fIdentFuncTable[I] := @func841;
595 842: fIdentFuncTable[I] := @func842;
596 845: fIdentFuncTable[I] := @func845;
597 853: fIdentFuncTable[I] := @func853;
598 855: fIdentFuncTable[I] := @func855;
599 857: fIdentFuncTable[I] := @func857;
600 860: fIdentFuncTable[I] := @func860;
601 864: fIdentFuncTable[I] := @func864;
602 867: fIdentFuncTable[I] := @func867;
603 868: fIdentFuncTable[I] := @func868;
604 869: fIdentFuncTable[I] := @func869;
605 870: fIdentFuncTable[I] := @func870;
606 873: fIdentFuncTable[I] := @func873;
607 874: fIdentFuncTable[I] := @func874;
608 876: fIdentFuncTable[I] := @func876;
609 877: fIdentFuncTable[I] := @func877;
610 878: fIdentFuncTable[I] := @func878;
611 881: fIdentFuncTable[I] := @func881;
612 883: fIdentFuncTable[I] := @func883;
613 890: fIdentFuncTable[I] := @func890;
614 892: fIdentFuncTable[I] := @func892;
615 906: fIdentFuncTable[I] := @func906;
616 933: fIdentFuncTable[I] := @func933;
617 954: fIdentFuncTable[I] := @func954;
618 956: fIdentFuncTable[I] := @func956;
619 965: fIdentFuncTable[I] := @func965;
620 968: fIdentFuncTable[I] := @func968;
621 974: fIdentFuncTable[I] := @func974;
622 978: fIdentFuncTable[I] := @func978;
623 981: fIdentFuncTable[I] := @func981;
624 985: fIdentFuncTable[I] := @func985;
625 986: fIdentFuncTable[I] := @func986;
626 988: fIdentFuncTable[I] := @func988;
627 1056: fIdentFuncTable[I] := @func1056;
628 1077: fIdentFuncTable[I] := @func1077;
629 1079: fIdentFuncTable[I] := @func1079;
630 1084: fIdentFuncTable[I] := @func1084;
631 1086: fIdentFuncTable[I] := @func1086;
632 1091: fIdentFuncTable[I] := @func1091;
633 1093: fIdentFuncTable[I] := @func1093;
634 1095: fIdentFuncTable[I] := @func1095;
635 1103: fIdentFuncTable[I] := @func1103;
636 1105: fIdentFuncTable[I] := @func1105;
637 1107: fIdentFuncTable[I] := @func1107;
638 1136: fIdentFuncTable[I] := @func1136;
639 1158: fIdentFuncTable[I] := @func1158;
640 1165: fIdentFuncTable[I] := @func1165;
641 1169: fIdentFuncTable[I] := @func1169;
642 1172: fIdentFuncTable[I] := @func1172;
643 1176: fIdentFuncTable[I] := @func1176;
644 1202: fIdentFuncTable[I] := @func1202;
645 1211: fIdentFuncTable[I] := @func1211;
646 1215: fIdentFuncTable[I] := @func1215;
647 1218: fIdentFuncTable[I] := @func1218;
648 1223: fIdentFuncTable[I] := @func1223;
649 1230: fIdentFuncTable[I] := @func1230;
650 1273: fIdentFuncTable[I] := @func1273;
651 1277: fIdentFuncTable[I] := @func1277;
652 1283: fIdentFuncTable[I] := @func1283;
653 1327: fIdentFuncTable[I] := @func1327;
654 1343: fIdentFuncTable[I] := @func1343;
655 1361: fIdentFuncTable[I] := @func1361;
656 1379: fIdentFuncTable[I] := @func1379;
657 1396: fIdentFuncTable[I] := @func1396;
658 1402: fIdentFuncTable[I] := @func1402;
659 1404: fIdentFuncTable[I] := @func1404;
660 1409: fIdentFuncTable[I] := @func1409;
661 1421: fIdentFuncTable[I] := @func1421;
662 1425: fIdentFuncTable[I] := @func1425;
663 1440: fIdentFuncTable[I] := @func1440;
664 1520: fIdentFuncTable[I] := @func1520;
665 1523: fIdentFuncTable[I] := @func1523;
666 1673: fIdentFuncTable[I] := @func1673;
667 1752: fIdentFuncTable[I] := @func1752;
668 1762: fIdentFuncTable[I] := @func1762;
669 1768: fIdentFuncTable[I] := @func1768;
670 2167: fIdentFuncTable[I] := @func2167;
671 else fIdentFuncTable[I] := @AltFunc;
672 end;
673 end;
674
KeyHashnull675 function TSynPerlSyn.KeyHash(ToHash: PChar): Integer;
676 begin
677 Result := 0;
678 while ToHash^ in ['%', '@', '$', '_', '0'..'9', 'a'..'z', 'A'..'Z'] do
679 begin
680 inc(Result, Integer(ToHash^));
681 inc(ToHash);
682 end;
683 fStringLen := ToHash - fToIdent;
684 end; { KeyHash }
685
KeyCompnull686 function TSynPerlSyn.KeyComp(const aKey: String): Boolean;
687 var
688 I: Integer;
689 Temp: PChar;
690 begin
691 Temp := fToIdent;
692 if Length(aKey) = fStringLen then
693 begin
694 Result := True;
695 for i := 1 to fStringLen do begin
696 if Temp^ <> aKey[i] then
697 begin
698 Result := False;
699 break;
700 end;
701 inc(Temp);
702 end;
703 end else Result := False;
704 end; { KeyComp }
705
Func109null706 function TSynPerlSyn.Func109: TtkTokenKind;
707 begin
708 if KeyComp('m') then Result := tkKey else Result := tkIdentifier;
709 end;
710
Func113null711 function TSynPerlSyn.Func113: TtkTokenKind;
712 begin
713 if KeyComp('q') then Result := tkKey else Result := tkIdentifier;
714 end;
715
TSynPerlSyn.Func196null716 function TSynPerlSyn.Func196: TtkTokenKind;
717 begin
718 if KeyComp('$NR') then Result := tkVariable else Result := tkIdentifier;
719 end;
720
Func201null721 function TSynPerlSyn.Func201: TtkTokenKind;
722 begin
723 if KeyComp('$RS') then Result := tkVariable else Result := tkIdentifier;
724 end;
725
TSynPerlSyn.Func204null726 function TSynPerlSyn.Func204: TtkTokenKind;
727 begin
728 if KeyComp('ge') then Result := tkOperator else Result := tkIdentifier;
729 end;
730
Func207null731 function TSynPerlSyn.Func207: TtkTokenKind;
732 begin
733 if KeyComp('lc') then Result := tkKey else
734 if KeyComp('if') then Result := tkKey else Result := tkIdentifier;
735 end;
736
Func209null737 function TSynPerlSyn.Func209: TtkTokenKind;
738 begin
739 if KeyComp('le') then Result := tkOperator else Result := tkIdentifier;
740 end;
741
Func211null742 function TSynPerlSyn.Func211: TtkTokenKind;
743 begin
744 if KeyComp('ne') then Result := tkOperator else
745 if KeyComp('do') then Result := tkKey else Result := tkIdentifier;
746 end;
747
TSynPerlSyn.Func214null748 function TSynPerlSyn.Func214: TtkTokenKind;
749 begin
750 if KeyComp('eq') then Result := tkOperator else Result := tkIdentifier;
751 end;
752
TSynPerlSyn.Func216null753 function TSynPerlSyn.Func216: TtkTokenKind;
754 begin
755 if KeyComp('uc') then Result := tkKey else Result := tkIdentifier;
756 end;
757
Func219null758 function TSynPerlSyn.Func219: TtkTokenKind;
759 begin
760 if KeyComp('gt') then Result := tkOperator else Result := tkIdentifier;
761 end;
762
Func221null763 function TSynPerlSyn.Func221: TtkTokenKind;
764 begin
765 if KeyComp('no') then Result := tkKey else Result := tkIdentifier;
766 end;
767
Func224null768 function TSynPerlSyn.Func224: TtkTokenKind;
769 begin
770 if KeyComp('lt') then Result := tkOperator else Result := tkIdentifier;
771 end;
772
TSynPerlSyn.Func225null773 function TSynPerlSyn.Func225: TtkTokenKind;
774 begin
775 if KeyComp('or') then Result := tkOperator else Result := tkIdentifier;
776 end;
777
TSynPerlSyn.Func226null778 function TSynPerlSyn.Func226: TtkTokenKind;
779 begin
780 if KeyComp('qq') then Result := tkKey else Result := tkIdentifier;
781 end;
782
TSynPerlSyn.Func230null783 function TSynPerlSyn.Func230: TtkTokenKind;
784 begin
785 if KeyComp('tr') then Result := tkKey else
786 if KeyComp('my') then Result := tkKey else Result := tkIdentifier;
787 end;
788
Func232null789 function TSynPerlSyn.Func232: TtkTokenKind;
790 begin
791 if KeyComp('qw') then Result := tkKey else Result := tkIdentifier;
792 end;
793
Func233null794 function TSynPerlSyn.Func233: TtkTokenKind;
795 begin
796 if KeyComp('qx') then Result := tkKey else Result := tkIdentifier;
797 end;
798
TSynPerlSyn.Func248null799 function TSynPerlSyn.Func248: TtkTokenKind;
800 begin
801 if KeyComp('$GID') then Result := tkVariable else Result := tkIdentifier;
802 end;
803
Func254null804 function TSynPerlSyn.Func254: TtkTokenKind;
805 begin
806 if KeyComp('$ARG') then Result := tkVariable else Result := tkIdentifier;
807 end;
808
Func255null809 function TSynPerlSyn.Func255: TtkTokenKind;
810 begin
811 if KeyComp('%INC') then Result := tkVariable else Result := tkIdentifier;
812 end;
813
Func257null814 function TSynPerlSyn.Func257: TtkTokenKind;
815 begin
816 if KeyComp('$PID') then Result := tkVariable else Result := tkIdentifier;
817 end;
818
TSynPerlSyn.Func262null819 function TSynPerlSyn.Func262: TtkTokenKind;
820 begin
821 if KeyComp('$UID') then Result := tkVariable else Result := tkIdentifier;
822 end;
823
TSynPerlSyn.Func263null824 function TSynPerlSyn.Func263: TtkTokenKind;
825 begin
826 if KeyComp('$SIG') then Result := tkVariable else Result := tkIdentifier;
827 end;
828
TSynPerlSyn.Func269null829 function TSynPerlSyn.Func269: TtkTokenKind;
830 begin
831 if KeyComp('$ENV') then Result := tkVariable else Result := tkIdentifier;
832 end;
833
Func280null834 function TSynPerlSyn.Func280: TtkTokenKind;
835 begin
836 if KeyComp('$ORS') then Result := tkVariable else Result := tkIdentifier;
837 end;
838
TSynPerlSyn.Func282null839 function TSynPerlSyn.Func282: TtkTokenKind;
840 begin
841 if KeyComp('@INC') then Result := tkVariable else Result := tkIdentifier;
842 end;
843
Func306null844 function TSynPerlSyn.Func306: TtkTokenKind;
845 begin
846 if KeyComp('die') then Result := tkKey else Result := tkIdentifier;
847 end;
848
Func307null849 function TSynPerlSyn.Func307: TtkTokenKind;
850 begin
851 if KeyComp('and') then Result := tkOperator else Result := tkIdentifier;
852 end;
853
Func310null854 function TSynPerlSyn.Func310: TtkTokenKind;
855 begin
856 if KeyComp('abs') then Result := tkKey else Result := tkIdentifier;
857 end;
858
TSynPerlSyn.Func314null859 function TSynPerlSyn.Func314: TtkTokenKind;
860 begin
861 if KeyComp('eof') then Result := tkKey else Result := tkIdentifier;
862 end;
863
Func317null864 function TSynPerlSyn.Func317: TtkTokenKind;
865 begin
866 if KeyComp('ref') then Result := tkKey else
867 if KeyComp('chr') then Result := tkKey else
868 if KeyComp('$EGID') then Result := tkVariable else Result := tkIdentifier;
869 end;
870
Func318null871 function TSynPerlSyn.Func318: TtkTokenKind;
872 begin
873 if KeyComp('vec') then Result := tkKey else
874 if KeyComp('map') then Result := tkKey else Result := tkIdentifier;
875 end;
876
Func320null877 function TSynPerlSyn.Func320: TtkTokenKind;
878 begin
879 if KeyComp('cmp') then Result := tkOperator else Result := tkIdentifier;
880 end;
881
Func322null882 function TSynPerlSyn.Func322: TtkTokenKind;
883 begin
884 if KeyComp('tie') then Result := tkKey else
885 if KeyComp('log') then Result := tkKey else Result := tkIdentifier;
886 end;
887
TSynPerlSyn.Func325null888 function TSynPerlSyn.Func325: TtkTokenKind;
889 begin
890 if KeyComp('hex') then Result := tkKey else
891 if KeyComp('ord') then Result := tkKey else
892 if KeyComp('cos') then Result := tkKey else Result := tkIdentifier;
893 end;
894
TSynPerlSyn.Func326null895 function TSynPerlSyn.Func326: TtkTokenKind;
896 begin
897 if KeyComp('oct') then Result := tkKey else Result := tkIdentifier;
898 end;
899
TSynPerlSyn.Func327null900 function TSynPerlSyn.Func327: TtkTokenKind;
901 begin
902 if KeyComp('for') then Result := tkKey else Result := tkIdentifier;
903 end;
904
TSynPerlSyn.Func330null905 function TSynPerlSyn.Func330: TtkTokenKind;
906 begin
907 if KeyComp('sin') then Result := tkKey else
908 if KeyComp('sub') then Result := tkKey else Result := tkIdentifier;
909 end;
910
Func331null911 function TSynPerlSyn.Func331: TtkTokenKind;
912 begin
913 if KeyComp('$EUID') then Result := tkVariable else
914 if KeyComp('int') then Result := tkKey else Result := tkIdentifier;
915 end;
916
Func333null917 function TSynPerlSyn.Func333: TtkTokenKind;
918 begin
919 if KeyComp('use') then Result := tkKey else
920 if KeyComp('exp') then Result := tkKey else Result := tkIdentifier;
921 end;
922
TSynPerlSyn.Func335null923 function TSynPerlSyn.Func335: TtkTokenKind;
924 begin
925 if KeyComp('pop') then Result := tkKey else Result := tkIdentifier;
926 end;
927
TSynPerlSyn.Func337null928 function TSynPerlSyn.Func337: TtkTokenKind;
929 begin
930 if KeyComp('not') then Result := tkOperator else Result := tkIdentifier;
931 end;
932
TSynPerlSyn.Func338null933 function TSynPerlSyn.Func338: TtkTokenKind;
934 begin
935 if KeyComp('pos') then Result := tkKey else Result := tkIdentifier;
936 end;
937
TSynPerlSyn.Func340null938 function TSynPerlSyn.Func340: TtkTokenKind;
939 begin
940 if KeyComp('$ARGV') then Result := tkVariable else Result := tkIdentifier;
941 end;
942
Func345null943 function TSynPerlSyn.Func345: TtkTokenKind;
944 begin
945 if KeyComp('xor') then Result := tkOperator else Result := tkIdentifier;
946 end;
947
TSynPerlSyn.Func346null948 function TSynPerlSyn.Func346: TtkTokenKind;
949 begin
950 if KeyComp('$OFMT') then Result := tkVariable else Result := tkIdentifier;
951 end;
952
TSynPerlSyn.Func368null953 function TSynPerlSyn.Func368: TtkTokenKind;
954 begin
955 if KeyComp('@ARGV') then Result := tkVariable else Result := tkIdentifier;
956 end;
957
TSynPerlSyn.Func401null958 function TSynPerlSyn.Func401: TtkTokenKind;
959 begin
960 if KeyComp('$MATCH') then Result := tkVariable else
961 if KeyComp('each') then Result := tkKey else Result := tkIdentifier;
962 end;
963
TSynPerlSyn.Func412null964 function TSynPerlSyn.Func412: TtkTokenKind;
965 begin
966 if KeyComp('read') then Result := tkKey else Result := tkIdentifier;
967 end;
968
TSynPerlSyn.Func413null969 function TSynPerlSyn.Func413: TtkTokenKind;
970 begin
971 if KeyComp('bind') then Result := tkKey else Result := tkIdentifier;
972 end;
973
TSynPerlSyn.Func415null974 function TSynPerlSyn.Func415: TtkTokenKind;
975 begin
976 if KeyComp('pack') then Result := tkKey else Result := tkIdentifier;
977 end;
978
TSynPerlSyn.Func419null979 function TSynPerlSyn.Func419: TtkTokenKind;
980 begin
981 if KeyComp('getc') then Result := tkKey else Result := tkIdentifier;
982 end;
983
Func420null984 function TSynPerlSyn.Func420: TtkTokenKind;
985 begin
986 if KeyComp('glob') then Result := tkKey else Result := tkIdentifier;
987 end;
988
Func421null989 function TSynPerlSyn.Func421: TtkTokenKind;
990 begin
991 if KeyComp('exec') then Result := tkKey else
992 if KeyComp('rand') then Result := tkKey else Result := tkIdentifier;
993 end;
994
TSynPerlSyn.Func424null995 function TSynPerlSyn.Func424: TtkTokenKind;
996 begin
997 if KeyComp('seek') then Result := tkKey else
998 if KeyComp('eval') then Result := tkKey else Result := tkIdentifier;
999 end;
1000
TSynPerlSyn.Func425null1001 function TSynPerlSyn.Func425: TtkTokenKind;
1002 begin
1003 if KeyComp('else') then Result := tkKey else Result := tkIdentifier;
1004 end;
1005
TSynPerlSyn.Func426null1006 function TSynPerlSyn.Func426: TtkTokenKind;
1007 begin
1008 if KeyComp('chop') then Result := tkKey else
1009 if KeyComp('redo') then Result := tkKey else
1010 if KeyComp('send') then Result := tkKey else
1011 if KeyComp('$ERRNO') then Result := tkVariable else Result := tkIdentifier;
1012 end;
1013
Func428null1014 function TSynPerlSyn.Func428: TtkTokenKind;
1015 begin
1016 if KeyComp('kill') then Result := tkKey else Result := tkIdentifier;
1017 end;
1018
Func430null1019 function TSynPerlSyn.Func430: TtkTokenKind;
1020 begin
1021 if KeyComp('grep') then Result := tkKey else
1022 if KeyComp('pipe') then Result := tkKey else
1023 if KeyComp('link') then Result := tkKey else Result := tkIdentifier;
1024 end;
1025
Func431null1026 function TSynPerlSyn.Func431: TtkTokenKind;
1027 begin
1028 if KeyComp('time') then Result := tkKey else Result := tkIdentifier;
1029 end;
1030
Func432null1031 function TSynPerlSyn.Func432: TtkTokenKind;
1032 begin
1033 if KeyComp('recv') then Result := tkKey else
1034 if KeyComp('join') then Result := tkKey else Result := tkIdentifier;
1035 end;
1036
Func433null1037 function TSynPerlSyn.Func433: TtkTokenKind;
1038 begin
1039 if KeyComp('tell') then Result := tkKey else Result := tkIdentifier;
1040 end;
1041
TSynPerlSyn.Func434null1042 function TSynPerlSyn.Func434: TtkTokenKind;
1043 begin
1044 if KeyComp('open') then Result := tkKey else
1045 if KeyComp('fork') then Result := tkKey else Result := tkIdentifier;
1046 end;
1047
TSynPerlSyn.Func436null1048 function TSynPerlSyn.Func436: TtkTokenKind;
1049 begin
1050 if KeyComp('last') then Result := tkKey else Result := tkIdentifier;
1051 end;
1052
TSynPerlSyn.Func437null1053 function TSynPerlSyn.Func437: TtkTokenKind;
1054 begin
1055 if KeyComp('wait') then Result := tkKey else Result := tkIdentifier;
1056 end;
1057
Func438null1058 function TSynPerlSyn.Func438: TtkTokenKind;
1059 begin
1060 if KeyComp('dump') then Result := tkKey else Result := tkIdentifier;
1061 end;
1062
Func439null1063 function TSynPerlSyn.Func439: TtkTokenKind;
1064 begin
1065 if KeyComp('less') then Result := tkPragma else Result := tkIdentifier;
1066 end;
1067
TSynPerlSyn.Func440null1068 function TSynPerlSyn.Func440: TtkTokenKind;
1069 begin
1070 if KeyComp('warn') then Result := tkKey else Result := tkIdentifier;
1071 end;
1072
Func441null1073 function TSynPerlSyn.Func441: TtkTokenKind;
1074 begin
1075 if KeyComp('goto') then Result := tkKey else Result := tkIdentifier;
1076 end;
1077
Func442null1078 function TSynPerlSyn.Func442: TtkTokenKind;
1079 begin
1080 if KeyComp('exit') then Result := tkKey else Result := tkIdentifier;
1081 end;
1082
Func444null1083 function TSynPerlSyn.Func444: TtkTokenKind;
1084 begin
1085 if KeyComp('vars') then Result := tkPragma else
1086 if KeyComp('keys') then Result := tkKey else
1087 if KeyComp('stat') then Result := tkKey else Result := tkIdentifier;
1088 end;
1089
TSynPerlSyn.Func445null1090 function TSynPerlSyn.Func445: TtkTokenKind;
1091 begin
1092 if KeyComp('subs') then Result := tkPragma else Result := tkIdentifier;
1093 end;
1094
TSynPerlSyn.Func447null1095 function TSynPerlSyn.Func447: TtkTokenKind;
1096 begin
1097 if KeyComp('next') then Result := tkKey else Result := tkIdentifier;
1098 end;
1099
TSynPerlSyn.Func448null1100 function TSynPerlSyn.Func448: TtkTokenKind;
1101 begin
1102 if KeyComp('push') then Result := tkKey else Result := tkIdentifier;
1103 end;
1104
TSynPerlSyn.Func456null1105 function TSynPerlSyn.Func456: TtkTokenKind;
1106 begin
1107 if KeyComp('sort') then Result := tkKey else Result := tkIdentifier;
1108 end;
1109
TSynPerlSyn.Func458null1110 function TSynPerlSyn.Func458: TtkTokenKind;
1111 begin
1112 if KeyComp('sqrt') then Result := tkKey else Result := tkIdentifier;
1113 end;
1114
TSynPerlSyn.Func470null1115 function TSynPerlSyn.Func470: TtkTokenKind;
1116 begin
1117 if KeyComp('atan2') then Result := tkKey else Result := tkIdentifier;
1118 end;
1119
Func477null1120 function TSynPerlSyn.Func477: TtkTokenKind;
1121 begin
1122 if KeyComp('$PERLDB') then Result := tkVariable else Result := tkIdentifier;
1123 end;
1124
TSynPerlSyn.Func502null1125 function TSynPerlSyn.Func502: TtkTokenKind;
1126 begin
1127 if KeyComp('$SUBSEP') then Result := tkVariable else Result := tkIdentifier;
1128 end;
1129
TSynPerlSyn.Func522null1130 function TSynPerlSyn.Func522: TtkTokenKind;
1131 begin
1132 if KeyComp('chdir') then Result := tkKey else Result := tkIdentifier;
1133 end;
1134
TSynPerlSyn.Func523null1135 function TSynPerlSyn.Func523: TtkTokenKind;
1136 begin
1137 if KeyComp('local') then Result := tkKey else
1138 if KeyComp('chmod') then Result := tkKey else Result := tkIdentifier;
1139 end;
1140
TSynPerlSyn.Func525null1141 function TSynPerlSyn.Func525: TtkTokenKind;
1142 begin
1143 if KeyComp('alarm') then Result := tkKey else Result := tkIdentifier;
1144 end;
1145
Func527null1146 function TSynPerlSyn.Func527: TtkTokenKind;
1147 begin
1148 if KeyComp('flock') then Result := tkKey else Result := tkIdentifier;
1149 end;
1150
Func530null1151 function TSynPerlSyn.Func530: TtkTokenKind;
1152 begin
1153 if KeyComp('undef') then Result := tkKey else Result := tkIdentifier;
1154 end;
1155
Func531null1156 function TSynPerlSyn.Func531: TtkTokenKind;
1157 begin
1158 if KeyComp('elsif') then Result := tkKey else Result := tkIdentifier;
1159 end;
1160
TSynPerlSyn.Func534null1161 function TSynPerlSyn.Func534: TtkTokenKind;
1162 begin
1163 if KeyComp('close') then Result := tkKey else Result := tkIdentifier;
1164 end;
1165
TSynPerlSyn.Func535null1166 function TSynPerlSyn.Func535: TtkTokenKind;
1167 begin
1168 if KeyComp('mkdir') then Result := tkKey else
1169 if KeyComp('fcntl') then Result := tkKey else
1170 if KeyComp('chomp') then Result := tkKey else Result := tkIdentifier;
1171 end;
1172
TSynPerlSyn.Func536null1173 function TSynPerlSyn.Func536: TtkTokenKind;
1174 begin
1175 if KeyComp('index') then Result := tkKey else
1176 if KeyComp('srand') then Result := tkKey else Result := tkIdentifier;
1177 end;
1178
Func537null1179 function TSynPerlSyn.Func537: TtkTokenKind;
1180 begin
1181 if KeyComp('sleep') then Result := tkKey else
1182 if KeyComp('while') then Result := tkKey else
1183 if KeyComp('bless') then Result := tkKey else Result := tkIdentifier;
1184 end;
1185
Func539null1186 function TSynPerlSyn.Func539: TtkTokenKind;
1187 begin
1188 if KeyComp('ioctl') then Result := tkKey else Result := tkIdentifier;
1189 end;
1190
Func542null1191 function TSynPerlSyn.Func542: TtkTokenKind;
1192 begin
1193 if KeyComp('shift') then Result := tkKey else
1194 if KeyComp('rmdir') then Result := tkKey else Result := tkIdentifier;
1195 end;
1196
Func543null1197 function TSynPerlSyn.Func543: TtkTokenKind;
1198 begin
1199 if KeyComp('chown') then Result := tkKey else Result := tkIdentifier;
1200 end;
1201
TSynPerlSyn.Func545null1202 function TSynPerlSyn.Func545: TtkTokenKind;
1203 begin
1204 if KeyComp('umask') then Result := tkKey else Result := tkIdentifier;
1205 end;
1206
TSynPerlSyn.Func546null1207 function TSynPerlSyn.Func546: TtkTokenKind;
1208 begin
1209 if KeyComp('times') then Result := tkKey else Result := tkIdentifier;
1210 end;
1211
TSynPerlSyn.Func547null1212 function TSynPerlSyn.Func547: TtkTokenKind;
1213 begin
1214 if KeyComp('reset') then Result := tkKey else Result := tkIdentifier;
1215 end;
1216
Func548null1217 function TSynPerlSyn.Func548: TtkTokenKind;
1218 begin
1219 if KeyComp('semop') then Result := tkKey else
1220 if KeyComp('utime') then Result := tkKey else Result := tkIdentifier;
1221 end;
1222
Func549null1223 function TSynPerlSyn.Func549: TtkTokenKind;
1224 begin
1225 if KeyComp('untie') then Result := tkKey else Result := tkIdentifier;
1226 end;
1227
Func552null1228 function TSynPerlSyn.Func552: TtkTokenKind;
1229 begin
1230 if KeyComp('lstat') then Result := tkKey else Result := tkIdentifier;
1231 end;
1232
TSynPerlSyn.Func555null1233 function TSynPerlSyn.Func555: TtkTokenKind;
1234 begin
1235 if KeyComp('write') then Result := tkKey else Result := tkIdentifier;
1236 end;
1237
TSynPerlSyn.Func556null1238 function TSynPerlSyn.Func556: TtkTokenKind;
1239 begin
1240 if KeyComp('split') then Result := tkKey else Result := tkIdentifier;
1241 end;
1242
TSynPerlSyn.Func557null1243 function TSynPerlSyn.Func557: TtkTokenKind;
1244 begin
1245 if KeyComp('print') then Result := tkKey else Result := tkIdentifier;
1246 end;
1247
Func562null1248 function TSynPerlSyn.Func562: TtkTokenKind;
1249 begin
1250 if KeyComp('crypt') then Result := tkKey else Result := tkIdentifier;
1251 end;
1252
TSynPerlSyn.Func569null1253 function TSynPerlSyn.Func569: TtkTokenKind;
1254 begin
1255 if KeyComp('study') then Result := tkKey else Result := tkIdentifier;
1256 end;
1257
TSynPerlSyn.Func570null1258 function TSynPerlSyn.Func570: TtkTokenKind;
1259 begin
1260 if KeyComp('$WARNING') then Result := tkVariable else Result := tkIdentifier;
1261 end;
1262
TSynPerlSyn.Func622null1263 function TSynPerlSyn.Func622: TtkTokenKind;
1264 begin
1265 if KeyComp('$BASETIME') then Result := tkVariable else Result := tkIdentifier;
1266 end;
1267
TSynPerlSyn.Func624null1268 function TSynPerlSyn.Func624: TtkTokenKind;
1269 begin
1270 if KeyComp('locale') then Result := tkPragma else
1271 if KeyComp('accept') then Result := tkKey else Result := tkIdentifier;
1272 end;
1273
Func627null1274 function TSynPerlSyn.Func627: TtkTokenKind;
1275 begin
1276 if KeyComp('caller') then Result := tkKey else
1277 if KeyComp('delete') then Result := tkKey else Result := tkIdentifier;
1278 end;
1279
Func630null1280 function TSynPerlSyn.Func630: TtkTokenKind;
1281 begin
1282 if KeyComp('scalar') then Result := tkKey else Result := tkIdentifier;
1283 end;
1284
TSynPerlSyn.Func632null1285 function TSynPerlSyn.Func632: TtkTokenKind;
1286 begin
1287 if KeyComp('rename') then Result := tkKey else
1288 if KeyComp('$PREMATCH') then Result := tkVariable else Result := tkIdentifier;
1289 end;
1290
Func637null1291 function TSynPerlSyn.Func637: TtkTokenKind;
1292 begin
1293 if KeyComp('fileno') then Result := tkKey else Result := tkIdentifier;
1294 end;
1295
Func640null1296 function TSynPerlSyn.Func640: TtkTokenKind;
1297 begin
1298 if KeyComp('splice') then Result := tkKey else
1299 if KeyComp('select') then Result := tkKey else Result := tkIdentifier;
1300 end;
1301
Func642null1302 function TSynPerlSyn.Func642: TtkTokenKind;
1303 begin
1304 if KeyComp('length') then Result := tkKey else
1305 if KeyComp('unpack') then Result := tkKey else Result := tkIdentifier;
1306 end;
1307
TSynPerlSyn.Func643null1308 function TSynPerlSyn.Func643: TtkTokenKind;
1309 begin
1310 if KeyComp('gmtime') then Result := tkKey else Result := tkIdentifier;
1311 end;
1312
TSynPerlSyn.Func645null1313 function TSynPerlSyn.Func645: TtkTokenKind;
1314 begin
1315 if KeyComp('semget') then Result := tkKey else Result := tkIdentifier;
1316 end;
1317
Func647null1318 function TSynPerlSyn.Func647: TtkTokenKind;
1319 begin
1320 if KeyComp('msgget') then Result := tkKey else Result := tkIdentifier;
1321 end;
1322
Func648null1323 function TSynPerlSyn.Func648: TtkTokenKind;
1324 begin
1325 if KeyComp('shmget') then Result := tkKey else
1326 if KeyComp('semctl') then Result := tkKey else Result := tkIdentifier;
1327 end;
1328
Func649null1329 function TSynPerlSyn.Func649: TtkTokenKind;
1330 begin
1331 if KeyComp('socket') then Result := tkKey else
1332 if KeyComp('format') then Result := tkKey else Result := tkIdentifier;
1333 end;
1334
Func650null1335 function TSynPerlSyn.Func650: TtkTokenKind;
1336 begin
1337 if KeyComp('rindex') then Result := tkKey else
1338 if KeyComp('msgctl') then Result := tkKey else Result := tkIdentifier;
1339 end;
1340
Func651null1341 function TSynPerlSyn.Func651: TtkTokenKind;
1342 begin
1343 if KeyComp('shmctl') then Result := tkKey else Result := tkIdentifier;
1344 end;
1345
Func652null1346 function TSynPerlSyn.Func652: TtkTokenKind;
1347 begin
1348 if KeyComp('msgsnd') then Result := tkKey else Result := tkIdentifier;
1349 end;
1350
TSynPerlSyn.Func655null1351 function TSynPerlSyn.Func655: TtkTokenKind;
1352 begin
1353 if KeyComp('listen') then Result := tkKey else
1354 if KeyComp('chroot') then Result := tkKey else Result := tkIdentifier;
1355 end;
1356
TSynPerlSyn.Func656null1357 function TSynPerlSyn.Func656: TtkTokenKind;
1358 begin
1359 if KeyComp('values') then Result := tkKey else Result := tkIdentifier;
1360 end;
1361
TSynPerlSyn.Func657null1362 function TSynPerlSyn.Func657: TtkTokenKind;
1363 begin
1364 if KeyComp('unlink') then Result := tkKey else Result := tkIdentifier;
1365 end;
1366
Func658null1367 function TSynPerlSyn.Func658: TtkTokenKind;
1368 begin
1369 if KeyComp('msgrcv') then Result := tkKey else Result := tkIdentifier;
1370 end;
1371
TSynPerlSyn.Func665null1372 function TSynPerlSyn.Func665: TtkTokenKind;
1373 begin
1374 if KeyComp('strict') then Result := tkPragma else Result := tkIdentifier;
1375 end;
1376
TSynPerlSyn.Func666null1377 function TSynPerlSyn.Func666: TtkTokenKind;
1378 begin
1379 if KeyComp('unless') then Result := tkKey else Result := tkIdentifier;
1380 end;
1381
TSynPerlSyn.Func667null1382 function TSynPerlSyn.Func667: TtkTokenKind;
1383 begin
1384 if KeyComp('import') then Result := tkKey else Result := tkIdentifier;
1385 end;
1386
Func672null1387 function TSynPerlSyn.Func672: TtkTokenKind;
1388 begin
1389 if KeyComp('return') then Result := tkKey else
1390 if KeyComp('exists') then Result := tkKey else Result := tkIdentifier;
1391 end;
1392
Func675null1393 function TSynPerlSyn.Func675: TtkTokenKind;
1394 begin
1395 if KeyComp('substr') then Result := tkKey else Result := tkIdentifier;
1396 end;
1397
TSynPerlSyn.Func677null1398 function TSynPerlSyn.Func677: TtkTokenKind;
1399 begin
1400 if KeyComp('system') then Result := tkKey else Result := tkIdentifier;
1401 end;
1402
TSynPerlSyn.Func687null1403 function TSynPerlSyn.Func687: TtkTokenKind;
1404 begin
1405 if KeyComp('$OS_ERROR') then Result := tkVariable else Result := tkIdentifier;
1406 end;
1407
TSynPerlSyn.Func688null1408 function TSynPerlSyn.Func688: TtkTokenKind;
1409 begin
1410 if KeyComp('$DEBUGGING') then Result := tkVariable else Result := tkIdentifier;
1411 end;
1412
TSynPerlSyn.Func716null1413 function TSynPerlSyn.Func716: TtkTokenKind;
1414 begin
1415 if KeyComp('package') then Result := tkKey else Result := tkIdentifier;
1416 end;
1417
TSynPerlSyn.Func719null1418 function TSynPerlSyn.Func719: TtkTokenKind;
1419 begin
1420 if KeyComp('defined') then Result := tkKey else Result := tkIdentifier;
1421 end;
1422
TSynPerlSyn.Func727null1423 function TSynPerlSyn.Func727: TtkTokenKind;
1424 begin
1425 if KeyComp('$POSTMATCH') then Result := tkVariable else Result := tkIdentifier;
1426 end;
1427
TSynPerlSyn.Func728null1428 function TSynPerlSyn.Func728: TtkTokenKind;
1429 begin
1430 if KeyComp('foreach') then Result := tkKey else Result := tkIdentifier;
1431 end;
1432
TSynPerlSyn.Func731null1433 function TSynPerlSyn.Func731: TtkTokenKind;
1434 begin
1435 if KeyComp('readdir') then Result := tkKey else Result := tkIdentifier;
1436 end;
1437
TSynPerlSyn.Func734null1438 function TSynPerlSyn.Func734: TtkTokenKind;
1439 begin
1440 if KeyComp('binmode') then Result := tkKey else Result := tkIdentifier;
1441 end;
1442
Func740null1443 function TSynPerlSyn.Func740: TtkTokenKind;
1444 begin
1445 if KeyComp('shmread') then Result := tkKey else Result := tkIdentifier;
1446 end;
1447
Func741null1448 function TSynPerlSyn.Func741: TtkTokenKind;
1449 begin
1450 if KeyComp('dbmopen') then Result := tkKey else Result := tkIdentifier;
1451 end;
1452
TSynPerlSyn.Func743null1453 function TSynPerlSyn.Func743: TtkTokenKind;
1454 begin
1455 if KeyComp('seekdir') then Result := tkKey else Result := tkIdentifier;
1456 end;
1457
Func746null1458 function TSynPerlSyn.Func746: TtkTokenKind;
1459 begin
1460 if KeyComp('connect') then Result := tkKey else Result := tkIdentifier;
1461 end;
1462
TSynPerlSyn.Func749null1463 function TSynPerlSyn.Func749: TtkTokenKind;
1464 begin
1465 if KeyComp('getppid') then Result := tkKey else Result := tkIdentifier;
1466 end;
1467
Func750null1468 function TSynPerlSyn.Func750: TtkTokenKind;
1469 begin
1470 if KeyComp('integer') then Result := tkPragma else Result := tkIdentifier;
1471 end;
1472
Func752null1473 function TSynPerlSyn.Func752: TtkTokenKind;
1474 begin
1475 if KeyComp('telldir') then Result := tkKey else Result := tkIdentifier;
1476 end;
1477
TSynPerlSyn.Func753null1478 function TSynPerlSyn.Func753: TtkTokenKind;
1479 begin
1480 if KeyComp('opendir') then Result := tkKey else Result := tkIdentifier;
1481 end;
1482
TSynPerlSyn.Func754null1483 function TSynPerlSyn.Func754: TtkTokenKind;
1484 begin
1485 if KeyComp('waitpid') then Result := tkKey else Result := tkIdentifier;
1486 end;
1487
Func759null1488 function TSynPerlSyn.Func759: TtkTokenKind;
1489 begin
1490 if KeyComp('lcfirst') then Result := tkKey else Result := tkIdentifier;
1491 end;
1492
Func761null1493 function TSynPerlSyn.Func761: TtkTokenKind;
1494 begin
1495 if KeyComp('getpgrp') then Result := tkKey else Result := tkIdentifier;
1496 end;
1497
Func762null1498 function TSynPerlSyn.Func762: TtkTokenKind;
1499 begin
1500 if KeyComp('sigtrap') then Result := tkPragma else Result := tkIdentifier;
1501 end;
1502
Func763null1503 function TSynPerlSyn.Func763: TtkTokenKind;
1504 begin
1505 if KeyComp('sysread') then Result := tkKey else
1506 if KeyComp('syscall') then Result := tkKey else Result := tkIdentifier;
1507 end;
1508
TSynPerlSyn.Func764null1509 function TSynPerlSyn.Func764: TtkTokenKind;
1510 begin
1511 if KeyComp('reverse') then Result := tkKey else Result := tkIdentifier;
1512 end;
1513
TSynPerlSyn.Func765null1514 function TSynPerlSyn.Func765: TtkTokenKind;
1515 begin
1516 if KeyComp('require') then Result := tkKey else Result := tkIdentifier;
1517 end;
1518
Func768null1519 function TSynPerlSyn.Func768: TtkTokenKind;
1520 begin
1521 if KeyComp('ucfirst') then Result := tkKey else Result := tkIdentifier;
1522 end;
1523
Func769null1524 function TSynPerlSyn.Func769: TtkTokenKind;
1525 begin
1526 if KeyComp('unshift') then Result := tkKey else Result := tkIdentifier;
1527 end;
1528
Func773null1529 function TSynPerlSyn.Func773: TtkTokenKind;
1530 begin
1531 if KeyComp('setpgrp') then Result := tkKey else Result := tkIdentifier;
1532 end;
1533
Func774null1534 function TSynPerlSyn.Func774: TtkTokenKind;
1535 begin
1536 if KeyComp('sprintf') then Result := tkKey else Result := tkIdentifier;
1537 end;
1538
TSynPerlSyn.Func775null1539 function TSynPerlSyn.Func775: TtkTokenKind;
1540 begin
1541 if KeyComp('symlink') then Result := tkKey else Result := tkIdentifier;
1542 end;
1543
TSynPerlSyn.Func815null1544 function TSynPerlSyn.Func815: TtkTokenKind;
1545 begin
1546 if KeyComp('$PROCESS_ID') then Result := tkVariable else Result := tkIdentifier;
1547 end;
1548
TSynPerlSyn.Func821null1549 function TSynPerlSyn.Func821: TtkTokenKind;
1550 begin
1551 if KeyComp('$EVAL_ERROR') then Result := tkVariable else Result := tkIdentifier;
1552 end;
1553
TSynPerlSyn.Func841null1554 function TSynPerlSyn.Func841: TtkTokenKind;
1555 begin
1556 if KeyComp('dbmclose') then Result := tkKey else Result := tkIdentifier;
1557 end;
1558
TSynPerlSyn.Func842null1559 function TSynPerlSyn.Func842: TtkTokenKind;
1560 begin
1561 if KeyComp('readlink') then Result := tkKey else Result := tkIdentifier;
1562 end;
1563
Func845null1564 function TSynPerlSyn.Func845: TtkTokenKind;
1565 begin
1566 if KeyComp('getgrgid') then Result := tkKey else Result := tkIdentifier;
1567 end;
1568
TSynPerlSyn.Func853null1569 function TSynPerlSyn.Func853: TtkTokenKind;
1570 begin
1571 if KeyComp('getgrnam') then Result := tkKey else
1572 if KeyComp('closedir') then Result := tkKey else Result := tkIdentifier;
1573 end;
1574
TSynPerlSyn.Func855null1575 function TSynPerlSyn.Func855: TtkTokenKind;
1576 begin
1577 if KeyComp('endgrent') then Result := tkKey else Result := tkIdentifier;
1578 end;
1579
Func857null1580 function TSynPerlSyn.Func857: TtkTokenKind;
1581 begin
1582 if KeyComp('getlogin') then Result := tkKey else Result := tkIdentifier;
1583 end;
1584
Func860null1585 function TSynPerlSyn.Func860: TtkTokenKind;
1586 begin
1587 if KeyComp('formline') then Result := tkKey else Result := tkIdentifier;
1588 end;
1589
TSynPerlSyn.Func864null1590 function TSynPerlSyn.Func864: TtkTokenKind;
1591 begin
1592 if KeyComp('getgrent') then Result := tkKey else Result := tkIdentifier;
1593 end;
1594
Func867null1595 function TSynPerlSyn.Func867: TtkTokenKind;
1596 begin
1597 if KeyComp('getpwnam') then Result := tkKey else Result := tkIdentifier;
1598 end;
1599
Func868null1600 function TSynPerlSyn.Func868: TtkTokenKind;
1601 begin
1602 if KeyComp('$ACCUMULATOR') then Result := tkVariable else Result := tkIdentifier;
1603 end;
1604
Func869null1605 function TSynPerlSyn.Func869: TtkTokenKind;
1606 begin
1607 if KeyComp('endpwent') then Result := tkKey else Result := tkIdentifier;
1608 end;
1609
Func870null1610 function TSynPerlSyn.Func870: TtkTokenKind;
1611 begin
1612 if KeyComp('truncate') then Result := tkKey else Result := tkIdentifier;
1613 end;
1614
Func873null1615 function TSynPerlSyn.Func873: TtkTokenKind;
1616 begin
1617 if KeyComp('getpwuid') then Result := tkKey else Result := tkIdentifier;
1618 end;
1619
TSynPerlSyn.Func874null1620 function TSynPerlSyn.Func874: TtkTokenKind;
1621 begin
1622 if KeyComp('constant') then Result := tkPragma else Result := tkIdentifier;
1623 end;
1624
TSynPerlSyn.Func876null1625 function TSynPerlSyn.Func876: TtkTokenKind;
1626 begin
1627 if KeyComp('setgrent') then Result := tkKey else Result := tkIdentifier;
1628 end;
1629
TSynPerlSyn.Func877null1630 function TSynPerlSyn.Func877: TtkTokenKind;
1631 begin
1632 if KeyComp('$FORMAT_NAME') then Result := tkVariable else Result := tkIdentifier;
1633 end;
1634
Func878null1635 function TSynPerlSyn.Func878: TtkTokenKind;
1636 begin
1637 if KeyComp('getpwent') then Result := tkKey else Result := tkIdentifier;
1638 end;
1639
Func881null1640 function TSynPerlSyn.Func881: TtkTokenKind;
1641 begin
1642 if KeyComp('$CHILD_ERROR') then Result := tkVariable else Result := tkIdentifier;
1643 end;
1644
Func883null1645 function TSynPerlSyn.Func883: TtkTokenKind;
1646 begin
1647 if KeyComp('shmwrite') then Result := tkKey else Result := tkIdentifier;
1648 end;
1649
TSynPerlSyn.Func890null1650 function TSynPerlSyn.Func890: TtkTokenKind;
1651 begin
1652 if KeyComp('setpwent') then Result := tkKey else Result := tkIdentifier;
1653 end;
1654
Func892null1655 function TSynPerlSyn.Func892: TtkTokenKind;
1656 begin
1657 if KeyComp('shutdown') then Result := tkKey else Result := tkIdentifier;
1658 end;
1659
TSynPerlSyn.Func906null1660 function TSynPerlSyn.Func906: TtkTokenKind;
1661 begin
1662 if KeyComp('syswrite') then Result := tkKey else Result := tkIdentifier;
1663 end;
1664
Func933null1665 function TSynPerlSyn.Func933: TtkTokenKind;
1666 begin
1667 if KeyComp('$INPLACE_EDIT') then Result := tkVariable else Result := tkIdentifier;
1668 end;
1669
TSynPerlSyn.Func954null1670 function TSynPerlSyn.Func954: TtkTokenKind;
1671 begin
1672 if KeyComp('localtime') then Result := tkKey else Result := tkIdentifier;
1673 end;
1674
Func956null1675 function TSynPerlSyn.Func956: TtkTokenKind;
1676 begin
1677 if KeyComp('$PROGRAM_NAME') then Result := tkVariable else Result := tkIdentifier;
1678 end;
1679
TSynPerlSyn.Func965null1680 function TSynPerlSyn.Func965: TtkTokenKind;
1681 begin
1682 if KeyComp('endnetent') then Result := tkKey else Result := tkIdentifier;
1683 end;
1684
Func968null1685 function TSynPerlSyn.Func968: TtkTokenKind;
1686 begin
1687 if KeyComp('rewinddir') then Result := tkKey else Result := tkIdentifier;
1688 end;
1689
TSynPerlSyn.Func974null1690 function TSynPerlSyn.Func974: TtkTokenKind;
1691 begin
1692 if KeyComp('getnetent') then Result := tkKey else Result := tkIdentifier;
1693 end;
1694
Func978null1695 function TSynPerlSyn.Func978: TtkTokenKind;
1696 begin
1697 if KeyComp('$REAL_USER_ID') then Result := tkVariable else Result := tkIdentifier;
1698 end;
1699
Func981null1700 function TSynPerlSyn.Func981: TtkTokenKind;
1701 begin
1702 if KeyComp('quotemeta') then Result := tkKey else Result := tkIdentifier;
1703 end;
1704
TSynPerlSyn.Func985null1705 function TSynPerlSyn.Func985: TtkTokenKind;
1706 begin
1707 if KeyComp('wantarray') then Result := tkKey else Result := tkIdentifier;
1708 end;
1709
TSynPerlSyn.Func986null1710 function TSynPerlSyn.Func986: TtkTokenKind;
1711 begin
1712 if KeyComp('setnetent') then Result := tkKey else Result := tkIdentifier;
1713 end;
1714
Func988null1715 function TSynPerlSyn.Func988: TtkTokenKind;
1716 begin
1717 if KeyComp('$PERL_VERSION') then Result := tkVariable else Result := tkIdentifier;
1718 end;
1719
TSynPerlSyn.Func1056null1720 function TSynPerlSyn.Func1056: TtkTokenKind;
1721 begin
1722 if KeyComp('$REAL_GROUP_ID') then Result := tkVariable else Result := tkIdentifier;
1723 end;
1724
Func1077null1725 function TSynPerlSyn.Func1077: TtkTokenKind;
1726 begin
1727 if KeyComp('socketpair') then Result := tkKey else Result := tkIdentifier;
1728 end;
1729
TSynPerlSyn.Func1079null1730 function TSynPerlSyn.Func1079: TtkTokenKind;
1731 begin
1732 if KeyComp('$SYSTEM_FD_MAX') then Result := tkVariable else Result := tkIdentifier;
1733 end;
1734
Func1084null1735 function TSynPerlSyn.Func1084: TtkTokenKind;
1736 begin
1737 if KeyComp('endhostent') then Result := tkKey else Result := tkIdentifier;
1738 end;
1739
TSynPerlSyn.Func1086null1740 function TSynPerlSyn.Func1086: TtkTokenKind;
1741 begin
1742 if KeyComp('endservent') then Result := tkKey else Result := tkIdentifier;
1743 end;
1744
Func1091null1745 function TSynPerlSyn.Func1091: TtkTokenKind;
1746 begin
1747 if KeyComp('getsockopt') then Result := tkKey else Result := tkIdentifier;
1748 end;
1749
TSynPerlSyn.Func1093null1750 function TSynPerlSyn.Func1093: TtkTokenKind;
1751 begin
1752 if KeyComp('gethostent') then Result := tkKey else Result := tkIdentifier;
1753 end;
1754
Func1095null1755 function TSynPerlSyn.Func1095: TtkTokenKind;
1756 begin
1757 if KeyComp('getservent') then Result := tkKey else Result := tkIdentifier;
1758 end;
1759
TSynPerlSyn.Func1103null1760 function TSynPerlSyn.Func1103: TtkTokenKind;
1761 begin
1762 if KeyComp('setsockopt') then Result := tkKey else Result := tkIdentifier;
1763 end;
1764
TSynPerlSyn.Func1105null1765 function TSynPerlSyn.Func1105: TtkTokenKind;
1766 begin
1767 if KeyComp('sethostent') then Result := tkKey else Result := tkIdentifier;
1768 end;
1769
Func1107null1770 function TSynPerlSyn.Func1107: TtkTokenKind;
1771 begin
1772 if KeyComp('setservent') then Result := tkKey else Result := tkIdentifier;
1773 end;
1774
TSynPerlSyn.Func1136null1775 function TSynPerlSyn.Func1136: TtkTokenKind;
1776 begin
1777 if KeyComp('$LIST_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1778 end;
1779
TSynPerlSyn.Func1158null1780 function TSynPerlSyn.Func1158: TtkTokenKind;
1781 begin
1782 if KeyComp('$EXECUTABLE_NAME') then Result := tkVariable else Result := tkIdentifier;
1783 end;
1784
Func1165null1785 function TSynPerlSyn.Func1165: TtkTokenKind;
1786 begin
1787 if KeyComp('getpeername') then Result := tkKey else Result := tkIdentifier;
1788 end;
1789
TSynPerlSyn.Func1169null1790 function TSynPerlSyn.Func1169: TtkTokenKind;
1791 begin
1792 if KeyComp('getsockname') then Result := tkKey else Result := tkIdentifier;
1793 end;
1794
Func1172null1795 function TSynPerlSyn.Func1172: TtkTokenKind;
1796 begin
1797 if KeyComp('$FORMAT_FORMFEED') then Result := tkVariable else Result := tkIdentifier;
1798 end;
1799
Func1176null1800 function TSynPerlSyn.Func1176: TtkTokenKind;
1801 begin
1802 if KeyComp('diagnostics') then Result := tkPragma else Result := tkIdentifier;
1803 end;
1804
TSynPerlSyn.Func1202null1805 function TSynPerlSyn.Func1202: TtkTokenKind;
1806 begin
1807 if KeyComp('endprotoent') then Result := tkKey else Result := tkIdentifier;
1808 end;
1809
TSynPerlSyn.Func1211null1810 function TSynPerlSyn.Func1211: TtkTokenKind;
1811 begin
1812 if KeyComp('getprotoent') then Result := tkKey else Result := tkIdentifier;
1813 end;
1814
TSynPerlSyn.Func1215null1815 function TSynPerlSyn.Func1215: TtkTokenKind;
1816 begin
1817 if KeyComp('$FORMAT_TOP_NAME') then Result := tkVariable else Result := tkIdentifier;
1818 end;
1819
TSynPerlSyn.Func1218null1820 function TSynPerlSyn.Func1218: TtkTokenKind;
1821 begin
1822 if KeyComp('getpriority') then Result := tkKey else Result := tkIdentifier;
1823 end;
1824
Func1223null1825 function TSynPerlSyn.Func1223: TtkTokenKind;
1826 begin
1827 if KeyComp('setprotoent') then Result := tkKey else Result := tkIdentifier;
1828 end;
1829
Func1230null1830 function TSynPerlSyn.Func1230: TtkTokenKind;
1831 begin
1832 if KeyComp('setpriority') then Result := tkKey else Result := tkIdentifier;
1833 end;
1834
TSynPerlSyn.Func1273null1835 function TSynPerlSyn.Func1273: TtkTokenKind;
1836 begin
1837 if KeyComp('$LAST_PAREN_MATCH') then Result := tkVariable else Result := tkIdentifier;
1838 end;
1839
TSynPerlSyn.Func1277null1840 function TSynPerlSyn.Func1277: TtkTokenKind;
1841 begin
1842 if KeyComp('getnetbyaddr') then Result := tkKey else Result := tkIdentifier;
1843 end;
1844
TSynPerlSyn.Func1283null1845 function TSynPerlSyn.Func1283: TtkTokenKind;
1846 begin
1847 if KeyComp('getnetbyname') then Result := tkKey else Result := tkIdentifier;
1848 end;
1849
Func1327null1850 function TSynPerlSyn.Func1327: TtkTokenKind;
1851 begin
1852 if KeyComp('$OUTPUT_AUTOFLUSH') then Result := tkVariable else Result := tkIdentifier;
1853 end;
1854
TSynPerlSyn.Func1343null1855 function TSynPerlSyn.Func1343: TtkTokenKind;
1856 begin
1857 if KeyComp('$EFFECTIVE_USER_ID') then Result := tkVariable else Result := tkIdentifier;
1858 end;
1859
TSynPerlSyn.Func1361null1860 function TSynPerlSyn.Func1361: TtkTokenKind;
1861 begin
1862 if KeyComp('$FORMAT_LINES_LEFT') then Result := tkVariable else Result := tkIdentifier;
1863 end;
1864
TSynPerlSyn.Func1379null1865 function TSynPerlSyn.Func1379: TtkTokenKind;
1866 begin
1867 if KeyComp('$INPUT_LINE_NUMBER') then Result := tkVariable else Result := tkIdentifier;
1868 end;
1869
Func1396null1870 function TSynPerlSyn.Func1396: TtkTokenKind;
1871 begin
1872 if KeyComp('gethostbyaddr') then Result := tkKey else Result := tkIdentifier;
1873 end;
1874
TSynPerlSyn.Func1402null1875 function TSynPerlSyn.Func1402: TtkTokenKind;
1876 begin
1877 if KeyComp('gethostbyname') then Result := tkKey else Result := tkIdentifier;
1878 end;
1879
Func1404null1880 function TSynPerlSyn.Func1404: TtkTokenKind;
1881 begin
1882 if KeyComp('getservbyname') then Result := tkKey else Result := tkIdentifier;
1883 end;
1884
TSynPerlSyn.Func1409null1885 function TSynPerlSyn.Func1409: TtkTokenKind;
1886 begin
1887 if KeyComp('$MULTILINE_MATCHING') then Result := tkVariable else Result := tkIdentifier;
1888 end;
1889
Func1421null1890 function TSynPerlSyn.Func1421: TtkTokenKind;
1891 begin
1892 if KeyComp('$EFFECTIVE_GROUP_ID') then Result := tkVariable else Result := tkIdentifier;
1893 end;
1894
Func1425null1895 function TSynPerlSyn.Func1425: TtkTokenKind;
1896 begin
1897 if KeyComp('$FORMAT_PAGE_NUMBER') then Result := tkVariable else Result := tkIdentifier;
1898 end;
1899
Func1440null1900 function TSynPerlSyn.Func1440: TtkTokenKind;
1901 begin
1902 if KeyComp('getservbyport') then Result := tkKey else Result := tkIdentifier;
1903 end;
1904
Func1520null1905 function TSynPerlSyn.Func1520: TtkTokenKind;
1906 begin
1907 if KeyComp('getprotobyname') then Result := tkKey else Result := tkIdentifier;
1908 end;
1909
TSynPerlSyn.Func1523null1910 function TSynPerlSyn.Func1523: TtkTokenKind;
1911 begin
1912 if KeyComp('$SUBSCRIPT_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1913 end;
1914
TSynPerlSyn.Func1673null1915 function TSynPerlSyn.Func1673: TtkTokenKind;
1916 begin
1917 if KeyComp('$FORMAT_LINES_PER_PAGE') then Result := tkVariable else Result := tkIdentifier;
1918 end;
1919
TSynPerlSyn.Func1752null1920 function TSynPerlSyn.Func1752: TtkTokenKind;
1921 begin
1922 if KeyComp('getprotobynumber') then Result := tkKey else Result := tkIdentifier;
1923 end;
1924
Func1762null1925 function TSynPerlSyn.Func1762: TtkTokenKind;
1926 begin
1927 if KeyComp('$INPUT_RECORD_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1928 end;
1929
TSynPerlSyn.Func1768null1930 function TSynPerlSyn.Func1768: TtkTokenKind;
1931 begin
1932 if KeyComp('$OUTPUT_FIELD_SEPARATOR') then Result := tkVariable else Result := tkIdentifier;
1933 end;
1934
TSynPerlSyn.Func2167null1935 function TSynPerlSyn.Func2167: TtkTokenKind;
1936 begin
1937 if KeyComp('$FORMAT_LINE_BREAK_CHARACTERS') then Result := tkVariable else Result := tkIdentifier;
1938 end;
1939
TSynPerlSyn.AltFuncnull1940 function TSynPerlSyn.AltFunc: TtkTokenKind;
1941 begin
1942 Result := tkIdentifier;
1943 end;
1944
TSynPerlSyn.IdentKindnull1945 function TSynPerlSyn.IdentKind(MayBe: PChar): TtkTokenKind;
1946 var
1947 HashKey: Integer;
1948 begin
1949 fToIdent := MayBe;
1950 HashKey := KeyHash(MayBe);
1951 if HashKey < 2168 then
1952 Result := fIdentFuncTable[HashKey]()
1953 else
1954 Result := tkIdentifier;
1955 end;
1956
1957 procedure TSynPerlSyn.MakeMethodTables;
1958 var
1959 I: Char;
1960 begin
1961 for I := #0 to #255 do
1962 case I of
1963 '&': fProcTable[I] := @AndSymbolProc;
1964 #13: fProcTable[I] := @CRProc;
1965 ':': fProcTable[I] := @ColonProc;
1966 '#': fProcTable[I] := @CommentProc;
1967 '=': fProcTable[I] := @EqualProc;
1968 '>': fProcTable[I] := @GreaterProc;
1969 '%', '@', '$', 'A'..'Z', 'a'..'z', '_':
1970 fProcTable[I] := @IdentProc;
1971 #10: fProcTable[I] := @LFProc;
1972 '<': fProcTable[I] := @LowerProc;
1973 '-': fProcTable[I] := @MinusProc;
1974 '!': fProcTable[I] := @NotSymbolProc;
1975 #0: fProcTable[I] := @NullProc;
1976 '0'..'9', '.': fProcTable[I] := @NumberProc;
1977 '|': fProcTable[I] := @OrSymbolProc;
1978 '+': fProcTable[I] := @PlusProc;
1979 '/': fProcTable[I] := @SlashProc;
1980 #1..#9, #11, #12, #14..#32: fProcTable[I] := @SpaceProc;
1981 '*': fProcTable[I] := @StarProc;
1982 #34: fProcTable[I] := @StringInterpProc;
1983 #39: fProcTable[I] := @StringLiteralProc;
1984 '^': fProcTable[I] := @XOrSymbolProc;
1985 '(', ')', '[', ']', '\', '{', '}', ',', ';', '?', '~':
1986 fProcTable[I] := @SymbolProc;
1987 else
1988 fProcTable[I] := @UnknownProc;
1989 end;
1990 end;
1991
1992 constructor TSynPerlSyn.Create(AOwner: TComponent);
1993 begin
1994 inherited Create(AOwner);
1995 fCommentAttri := TSynHighlighterAttributes.Create(@SYNS_AttrComment, SYNS_XML_AttrComment);
1996 fCommentAttri.Style:= [fsItalic];
1997 AddAttribute(fCommentAttri);
1998 fIdentifierAttri := TSynHighlighterAttributes.Create(@SYNS_AttrIdentifier, SYNS_XML_AttrIdentifier);
1999 AddAttribute(fIdentifierAttri);
2000 fInvalidAttri := TSynHighlighterAttributes.Create(@SYNS_AttrIllegalChar, SYNS_XML_AttrIllegalChar);
2001 AddAttribute(fInvalidAttri);
2002 fKeyAttri := TSynHighlighterAttributes.Create(@SYNS_AttrReservedWord, SYNS_XML_AttrReservedWord);
2003 fKeyAttri.Style:= [fsBold];
2004 AddAttribute(fKeyAttri);
2005 fNumberAttri := TSynHighlighterAttributes.Create(@SYNS_AttrNumber, SYNS_XML_AttrNumber);
2006 AddAttribute(fNumberAttri);
2007 fOperatorAttri := TSynHighlighterAttributes.Create(@SYNS_AttrOperator, SYNS_XML_AttrOperator);
2008 AddAttribute(fOperatorAttri);
2009 fPragmaAttri := TSynHighlighterAttributes.Create(@SYNS_AttrPragma, SYNS_XML_AttrPragma);
2010 fPragmaAttri.Style := [fsBold];
2011 AddAttribute(fPragmaAttri);
2012 fSpaceAttri := TSynHighlighterAttributes.Create(@SYNS_AttrSpace, SYNS_XML_AttrSpace);
2013 fSpaceAttri.Foreground := clWindow;
2014 AddAttribute(fSpaceAttri);
2015 fStringAttri := TSynHighlighterAttributes.Create(@SYNS_AttrString, SYNS_XML_AttrString);
2016 AddAttribute(fStringAttri);
2017 fSymbolAttri := TSynHighlighterAttributes.Create(@SYNS_AttrSymbol, SYNS_XML_AttrSymbol);
2018 AddAttribute(fSymbolAttri);
2019 fVariableAttri := TSynHighlighterAttributes.Create(@SYNS_AttrVariable, SYNS_XML_AttrVariable);
2020 fVariableAttri.Style := [fsBold];
2021 AddAttribute(fVariableAttri);
2022 SetAttributesOnChange(@DefHighlightChange);
2023 InitIdent;
2024 MakeMethodTables;
2025 fDefaultFilter := SYNS_FilterPerl;
2026 end; { Create }
2027
2028 procedure TSynPerlSyn.SetLine(const NewValue: String;
2029 LineNumber:Integer);
2030 begin
2031 inherited;
2032 fLine := PChar(NewValue);
2033 Run := 0;
2034 fLineNumber := LineNumber;
2035 Next;
2036 end; { SetLine }
2037
2038 procedure TSynPerlSyn.AndSymbolProc;
2039 begin
2040 case FLine[Run + 1] of
2041 '=': {bit and assign}
2042 begin
2043 inc(Run, 2);
2044 fTokenID := tkSymbol;
2045 end;
2046 '&':
2047 begin
2048 if FLine[Run + 2] = '=' then {logical and assign}
2049 inc(Run, 3)
2050 else {logical and}
2051 inc(Run, 2);
2052 fTokenID := tkSymbol;
2053 end;
2054 else {bit and}
2055 begin
2056 inc(Run);
2057 fTokenID := tkSymbol;
2058 end;
2059 end;
2060 end;
2061
2062 procedure TSynPerlSyn.CRProc;
2063 begin
2064 fTokenID := tkSpace;
2065 Case FLine[Run + 1] of
2066 #10: inc(Run, 2);
2067 else inc(Run);
2068 end;
2069 end;
2070
2071 procedure TSynPerlSyn.ColonProc;
2072 begin
2073 Case FLine[Run + 1] of
2074 ':': {double colon}
2075 begin
2076 inc(Run, 2);
2077 fTokenID := tkSymbol;
2078 end;
2079 else {colon}
2080 begin
2081 inc(Run);
2082 fTokenID := tkSymbol;
2083 end;
2084 end;
2085 end;
2086
2087 procedure TSynPerlSyn.CommentProc;
2088 begin
2089 fTokenID := tkComment;
2090 repeat
2091 case FLine[Run] of
2092 #0, #10, #13: break;
2093 end;
2094 inc(Run);
2095 until FLine[Run] = #0;
2096 end;
2097
2098 procedure TSynPerlSyn.EqualProc;
2099 begin
2100 case FLine[Run + 1] of
2101 '=': {logical equal}
2102 begin
2103 inc(Run, 2);
2104 fTokenID := tkSymbol;
2105 end;
2106 '>': {digraph}
2107 begin
2108 inc(Run, 2);
2109 fTokenID := tkSymbol;
2110 end;
2111 '~': {bind scalar to pattern}
2112 begin
2113 inc(Run, 2);
2114 fTokenID := tkSymbol;
2115 end;
2116 else {assign}
2117 begin
2118 inc(Run);
2119 fTokenID := tkSymbol;
2120 end;
2121 end;
2122 end;
2123
2124 procedure TSynPerlSyn.GreaterProc;
2125 begin
2126 Case FLine[Run + 1] of
2127 '=': {greater than or equal to}
2128 begin
2129 inc(Run, 2);
2130 fTokenID := tkSymbol;
2131 end;
2132 '>':
2133 begin
2134 if FLine[Run + 2] = '=' then {shift right assign}
2135 inc(Run, 3)
2136 else {shift right}
2137 inc(Run, 2);
2138 fTokenID := tkSymbol;
2139 end;
2140 else {greater than}
2141 begin
2142 inc(Run);
2143 fTokenID := tkSymbol;
2144 end;
2145 end;
2146 end;
2147
2148 procedure TSynPerlSyn.IdentProc;
2149 begin
2150 Case FLine[Run] of
2151 '$':
2152 begin
2153 Case FLine[Run + 1] of
2154 '!'..'+', '-'..'@', '['..']', '_', '`', '|', '~':
2155 begin {predefined variables}
2156 inc(Run, 2);
2157 fTokenID := tkVariable;
2158 exit;
2159 end;
2160 '^':
2161 begin
2162 Case FLine[Run + 2] of
2163 'A', 'D', 'F', 'I', 'L', 'P', 'T', 'W', 'X':
2164 begin {predefined variables}
2165 inc(Run, 3);
2166 fTokenID := tkVariable;
2167 exit;
2168 end;
2169 #0, #10, #13: {predefined variables}
2170 begin
2171 inc(Run, 2);
2172 fTokenID := tkVariable;
2173 exit;
2174 end;
2175 end;
2176 end;
2177 end;
2178 end;
2179 '%':
2180 begin
2181 Case FLine[Run + 1] of
2182 '=': {mod assign}
2183 begin
2184 inc(Run, 2);
2185 fTokenID := tkSymbol;
2186 exit;
2187 end;
2188 #0, #10, #13: {mod}
2189 begin
2190 inc(Run);
2191 fTokenID := tkSymbol;
2192 exit;
2193 end;
2194 end;
2195 end;
2196 'x':
2197 begin
2198 Case FLine[Run + 1] of
2199 '=': {repetition assign}
2200 begin
2201 inc(Run, 2);
2202 fTokenID := tkSymbol;
2203 exit;
2204 end;
2205 #0, #10, #13: {repetition}
2206 begin
2207 inc(Run);
2208 fTokenID := tkSymbol;
2209 exit;
2210 end;
2211 end;
2212 end;
2213 end;
2214 {regular identifier}
2215 fTokenID := IdentKind((fLine + Run));
2216 inc(Run, fStringLen);
2217 while Identifiers[fLine[Run]] do inc(Run);
2218 end;
2219
2220 procedure TSynPerlSyn.LFProc;
2221 begin
2222 fTokenID := tkSpace;
2223 inc(Run);
2224 end;
2225
2226 procedure TSynPerlSyn.LowerProc;
2227 begin
2228 case FLine[Run + 1] of
2229 '=':
2230 begin
2231 if FLine[Run + 2] = '>' then {compare - less than, equal, greater}
2232 inc(Run, 3)
2233 else {less than or equal to}
2234 inc(Run, 2);
2235 fTokenID := tkSymbol;
2236 end;
2237 '<':
2238 begin
2239 if FLine[Run + 2] = '=' then {shift left assign}
2240 inc(Run, 3)
2241 else {shift left}
2242 inc(Run, 2);
2243 fTokenID := tkSymbol;
2244 end;
2245 else {less than}
2246 begin
2247 inc(Run);
2248 fTokenID := tkSymbol;
2249 end;
2250 end;
2251 end;
2252
2253 procedure TSynPerlSyn.MinusProc;
2254 begin
2255 case FLine[Run + 1] of
2256 '=': {subtract assign}
2257 begin
2258 inc(Run, 2);
2259 fTokenID := tkSymbol;
2260 end;
2261 '-': {decrement}
2262 begin
2263 inc(Run, 2);
2264 fTokenID := tkSymbol;
2265 end;
2266 '>': {arrow}
2267 begin
2268 inc(Run, 2);
2269 fTokenID := tkSymbol;
2270 end;
2271 else {subtract}
2272 begin
2273 inc(Run);
2274 fTokenID := tkSymbol;
2275 end;
2276 end;
2277 end;
2278
2279 procedure TSynPerlSyn.NotSymbolProc;
2280 begin
2281 case FLine[Run + 1] of
2282 '~': {logical negated bind like =~}
2283 begin
2284 inc(Run, 2);
2285 fTokenID := tkSymbol;
2286 end;
2287 '=': {not equal}
2288 begin
2289 inc(Run, 2);
2290 fTokenID := tkSymbol;
2291 end;
2292 else {not}
2293 begin
2294 inc(Run);
2295 fTokenID := tkSymbol;
2296 end;
2297 end;
2298 end;
2299
2300 procedure TSynPerlSyn.NullProc;
2301 begin
2302 fTokenID := tkNull;
2303 end;
2304
2305 procedure TSynPerlSyn.NumberProc;
2306 begin
2307 if FLine[Run] = '.' then
2308 begin
2309 case FLine[Run + 1] of
2310 '.':
2311 begin
2312 inc(Run, 2);
2313 if FLine[Run] = '.' then {sed range}
2314 inc(Run);
2315
2316 fTokenID := tkSymbol; {range}
2317 exit;
2318 end;
2319 '=':
2320 begin
2321 inc(Run, 2);
2322 fTokenID := tkSymbol; {concatenation assign}
2323 exit;
2324 end;
2325 'a'..'z', 'A'..'Z', '_':
2326 begin
2327 fTokenID := tkSymbol; {concatenation}
2328 inc(Run);
2329 exit;
2330 end;
2331 end;
2332 end;
2333
2334 fTokenID := tkNumber;
2335
2336 if (FLine[Run] = '0') and (FLine[Run+1] in ['x', 'X'])then
2337 begin
2338 inc(Run, 2);
2339 while FLine[Run] in ['0'..'9', 'A'..'F', 'a'..'f'] do inc(Run);
2340 exit;
2341 end;
2342
2343 inc(Run);
2344 while FLine[Run] in ['0'..'9'] do inc(Run);
2345 if (FLine[Run]='.') and not(fLine[Run+1]='.') then begin
2346 inc(Run);
2347 while FLine[Run] in ['0'..'9'] do inc(Run);
2348 end;
2349 if (FLine[Run]='e') or (fLine[Run]='E') then begin
2350 inc(Run);
2351 if (FLine[Run]='+') or (fLine[Run]='-') then inc(Run);
2352 while FLine[Run] in ['0'..'9'] do inc(Run);
2353 end;
2354 end;
2355
2356 procedure TSynPerlSyn.OrSymbolProc;
2357 begin
2358 case FLine[Run + 1] of
2359 '=': {bit or assign}
2360 begin
2361 inc(Run, 2);
2362 fTokenID := tkSymbol;
2363 end;
2364 '|':
2365 begin
2366 if FLine[Run + 2] = '=' then {logical or assign}
2367 inc(Run, 3)
2368 else {logical or}
2369 inc(Run, 2);
2370 fTokenID := tkSymbol;
2371 end;
2372 else {bit or}
2373 begin
2374 inc(Run);
2375 fTokenID := tkSymbol;
2376 end;
2377 end;
2378 end;
2379
2380 procedure TSynPerlSyn.PlusProc;
2381 begin
2382 case FLine[Run + 1] of
2383 '=': {add assign}
2384 begin
2385 inc(Run, 2);
2386 fTokenID := tkSymbol;
2387 end;
2388 '+': {increment}
2389 begin
2390 inc(Run, 2);
2391 fTokenID := tkSymbol;
2392 end;
2393 else {add}
2394 begin
2395 inc(Run);
2396 fTokenID := tkSymbol;
2397 end;
2398 end;
2399 end;
2400
2401 procedure TSynPerlSyn.SlashProc;
2402 begin
2403 case FLine[Run + 1] of
2404 '=': {division assign}
2405 begin
2406 inc(Run, 2);
2407 fTokenID := tkSymbol;
2408 end;
2409 else {division}
2410 begin
2411 inc(Run);
2412 fTokenID := tkSymbol;
2413 end;
2414 end;
2415 end;
2416
2417 procedure TSynPerlSyn.SpaceProc;
2418 begin
2419 inc(Run);
2420 fTokenID := tkSpace;
2421 while FLine[Run] in [#1..#9, #11, #12, #14..#32] do inc(Run);
2422 end;
2423
2424 procedure TSynPerlSyn.StarProc;
2425 begin
2426 case FLine[Run + 1] of
2427 '=': {multiply assign}
2428 begin
2429 inc(Run, 2);
2430 fTokenID := tkSymbol;
2431 end;
2432 '*':
2433 begin
2434 if FLine[Run + 2] = '=' then {exponentiation assign}
2435 inc(Run, 3)
2436 else {exponentiation}
2437 inc(Run, 2);
2438 fTokenID := tkSymbol;
2439 end;
2440 else {multiply}
2441 begin
2442 inc(Run);
2443 fTokenID := tkSymbol;
2444 end;
2445 end;
2446 end;
2447
2448 procedure TSynPerlSyn.StringInterpProc;
2449 begin
2450 fTokenID := tkString;
2451 if (FLine[Run + 1] = #34) and (FLine[Run + 2] = #34) then inc(Run, 2);
2452 repeat
2453 case FLine[Run] of
2454 #0, #10, #13: break;
2455 #92:
2456 { backslash quote not the ending one }
2457 if FLine[Run + 1] = #34 then inc(Run);
2458 end;
2459 inc(Run);
2460 until FLine[Run] = #34;
2461 if FLine[Run] <> #0 then inc(Run);
2462 end;
2463
2464 procedure TSynPerlSyn.StringLiteralProc;
2465 begin
2466 fTokenID := tkString;
2467 repeat
2468 case FLine[Run] of
2469 #0, #10, #13: break;
2470 end;
2471 inc(Run);
2472 until FLine[Run] = #39;
2473 if FLine[Run] <> #0 then inc(Run);
2474 end;
2475
2476 procedure TSynPerlSyn.SymbolProc;
2477 begin
2478 inc(Run);
2479 fTokenId := tkSymbol;
2480 end;
2481
2482 procedure TSynPerlSyn.XOrSymbolProc;
2483 begin
2484 Case FLine[Run + 1] of
2485 '=': {xor assign}
2486 begin
2487 inc(Run, 2);
2488 fTokenID := tkSymbol;
2489 end;
2490 else {xor}
2491 begin
2492 inc(Run);
2493 fTokenID := tkSymbol;
2494 end;
2495 end;
2496 end;
2497
2498 procedure TSynPerlSyn.UnknownProc;
2499 begin
2500 {$IFDEF SYN_MBCSSUPPORT}
2501 if FLine[Run] in LeadBytes then
2502 Inc(Run,2)
2503 else
2504 {$ENDIF}
2505 inc(Run);
2506 while (fLine[Run] in [#128..#191]) OR // continued utf8 subcode
2507 ((fLine[Run]<>#0) and (fProcTable[fLine[Run]] = @UnknownProc)) do inc(Run);
2508 fTokenID := tkUnknown;
2509 end;
2510
2511 procedure TSynPerlSyn.Next;
2512 begin
2513 fTokenPos := Run;
2514 fProcTable[fLine[Run]]();
2515 end;
2516
TSynPerlSyn.GetDefaultAttributenull2517 function TSynPerlSyn.GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
2518 begin
2519 case Index of
2520 SYN_ATTR_COMMENT: Result := fCommentAttri;
2521 SYN_ATTR_IDENTIFIER: Result := fIdentifierAttri;
2522 SYN_ATTR_KEYWORD: Result := fKeyAttri;
2523 SYN_ATTR_STRING: Result := fStringAttri;
2524 SYN_ATTR_WHITESPACE: Result := fSpaceAttri;
2525 SYN_ATTR_SYMBOL: Result := fSymbolAttri;
2526 SYN_ATTR_NUMBER: Result := fNumberAttri;
2527 SYN_ATTR_VARIABLE: Result := fVariableAttri;
2528 else
2529 Result := nil;
2530 end;
2531 end;
2532
GetEolnull2533 function TSynPerlSyn.GetEol: Boolean;
2534 begin
2535 Result := fTokenID = tkNull;
2536 end;
2537
TSynPerlSyn.GetTokennull2538 function TSynPerlSyn.GetToken: string;
2539 var
2540 Len: LongInt;
2541 begin
2542 Result := '';
2543 Len := Run - fTokenPos;
2544 SetString(Result, (FLine + fTokenPos), Len);
2545 end;
2546
2547 procedure TSynPerlSyn.GetTokenEx(out TokenStart: PChar;
2548 out TokenLength: integer);
2549 begin
2550 TokenLength:=Run-fTokenPos;
2551 TokenStart:=FLine + fTokenPos;
2552 end;
2553
GetTokenIDnull2554 function TSynPerlSyn.GetTokenID: TtkTokenKind;
2555 begin
2556 Result := fTokenId;
2557 end;
2558
TSynPerlSyn.GetTokenAttributenull2559 function TSynPerlSyn.GetTokenAttribute: TSynHighlighterAttributes;
2560 begin
2561 case fTokenID of
2562 tkComment: Result := fCommentAttri;
2563 tkIdentifier: Result := fIdentifierAttri;
2564 tkKey: Result := fKeyAttri;
2565 tkNumber: Result := fNumberAttri;
2566 tkOperator: Result := fOperatorAttri;
2567 tkPragma: Result := fPragmaAttri;
2568 tkSpace: Result := fSpaceAttri;
2569 tkString: Result := fStringAttri;
2570 tkSymbol: Result := fSymbolAttri;
2571 tkUnknown: Result := fInvalidAttri;
2572 tkVariable: Result := fVariableAttri;
2573 else Result := nil;
2574 end;
2575 end;
2576
GetTokenKindnull2577 function TSynPerlSyn.GetTokenKind: integer;
2578 begin
2579 Result := Ord(fTokenId);
2580 end;
2581
TSynPerlSyn.GetTokenPosnull2582 function TSynPerlSyn.GetTokenPos: Integer;
2583 begin
2584 Result := fTokenPos;
2585 end;
2586
GetIdentCharsnull2587 function TSynPerlSyn.GetIdentChars: TSynIdentChars;
2588 begin
2589 Result := ['%', '@', '$', '_', '0'..'9', 'a'..'z', 'A'..'Z'] + TSynSpecialChars;
2590 end;
2591
TSynPerlSyn.GetLanguageNamenull2592 class function TSynPerlSyn.GetLanguageName: string;
2593 begin
2594 Result := SYNS_LangPerl;
2595 end;
2596
2597 initialization
2598 MakeIdentTable;
2599 RegisterPlaceableHighlighter(TSynPerlSyn);
2600
2601 end.
2602
2603