---input--- // vim:ft=pascal unit YTools; {=============================================================================== cYcnus.YTools 1.0.3 Beta for Delphi 4+ by licenser and Murphy ©2000-2003 by cYcnus visit www.cYcnus.de licenser@cYcnus.de (Heinz N. Gies) murphy@cYcnus.de (Kornelius Kalnbach) this unit is published under the terms of the GPL ===============================================================================} interface uses Windows, SysUtils, Classes, YTypes; const BackSpace = #8; Tab = #9; LF = #10; //Line Feed CR = #13; //Carriage Return Space = #32; EOLChars = [CR, LF]; {$IFNDEF VER140} sLineBreak = #13#10; SwitchChars = ['/', '-']; {$ENDIF} EOL = sLineBreak; MaxCard = High(Cardinal); AllChars = [#0..#255]; Alphabetical = ['A'..'Z', 'a'..'z']; DecimalChars = ['0'..'9']; AlphaNumerical = Alphabetical + DecimalChars; StrangeChars = [#0..#31, #127, #129, #141..#144, #157, #158]; HexadecimalChars = DecimalChars + ['A'..'F', 'a'..'f']; OctalChars = ['0'..'7']; BinaryChars = ['0', '1']; QuoteChars = ['''', '"']; WildCards = ['*', '?']; FileNameEnemies = WildCards + ['\', '/', ':', '<', '>', '|']; HexChar: array[THex] of Char = ( '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); LowerHexChar: array[THex] of Char = ( '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'); BaseNChar: array[TBaseN] of Char = ( '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H', 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); cYcnusOverlayColor = $050001; faFindEveryFile = faReadOnly + faHidden + faSysFile + faArchive; platWin9x = [VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS]; { Debugging } procedure ClearReport(const ReportName: string); procedure Report(const ReportName, Text: string); procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const); { Params } procedure GetParams(Strings: TStrings); overload; function GetParams(const Separator: string = ' '): string; overload; function ParamNum(const S: string): Integer; function ParamPrefixNum(const Prefix: string): Integer; function Param(const S: string): Boolean; function ParamPrefix(const Prefix: string): Boolean; function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars; IgnoreCase: Boolean = True): Boolean; function GetParam(const Prefix: string = ''; const Default: string = ''): string; { Dirs & UserName} function GetMyDir(FullPath: Boolean = False): string; function WinDir: string; function SysDir: string; function UserName: string; { Strings & Chars} function FirstChar(const S: string): Char; function LastChar(const S: string): Char; function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer; overload; function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer; overload; function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer; function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer; function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer; function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer; function UntilChar(const S: string; Brake: Char): string; overload; function UntilChar(const S: string; Brake: TCharSet): string; overload; function UntilLastChar(const S: string; Brake: Char; IgnoreNoBrake: Boolean = True): string; function FromChar(const S: string; Brake: Char): string; overload; function FromChar(const S: string; Brake: TCharSet): string; overload; function FromLastChar(const S: string; Brake: Char; IgnoreNoBrake: Boolean = False): string; function BetweenChars(const S: string; Start, Finish: Char; Inclusive: Boolean = False): string; function UntilStr(const S: string; Brake: string): string; function FromStr(const S: string; Brake: string): string; function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string; { Splitting & Combining } function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; overload; procedure Split(const S, Separator: string; Strings: TStrings; IgnoreMultiSep: Boolean = True); overload; function Split(const S: string; Separators: TCharSet; IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; overload; procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer; out Left, Right: string); function Join(Strings: TStrings; Separator: string = ' '): string; overload; function Join(StrA: TStrA; Separator: string = ' '): string; overload; function MulStr(const S: string; Count: Integer): string; { Strings ausrichten } function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string; function MaxStr(const S: string; MaxLen: Integer): string; { Stringing } function TrimAll(const S: string): string; function ControlChar(C: Char): Boolean; function FriendlyChar(C: Char): Char; function FriendlyStr(const S: string): string; overload; function FriendlyStr(a: TByteA): string; overload; function Quote(const S: string; Quoter: Char = '"'): string; function UnQuote(const S: string): string; function DeQuote(const S: string): string; function StrNumerus(const Value: Integer; const Singular, Plural: string; const Zero: string = '0'): string; function MakeStr(const Items: array of const; Separator: string = ''): string; procedure ShowText(const Items: array of const; Separator: string = ''); { Delete } function DeleteChars(const S: string; C: Char): string; overload; function DeleteChars(const S: string; C: TCharSet): string; overload; function ExtractChars(const S: string; C: TCharSet): string; { Find } function CharCount(const S: string; C: Char): Integer; function CharIn(const S: string; C: Char): Boolean; overload; function CharIn(const S: string; C: TCharSet): Boolean; overload; function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean; function StrAtBegin(const S, Str: string): Boolean; function StrIn(const S, SubStr: string): Boolean; overload; function StrIn(A: TStrA; const S: string): Boolean; overload; function StrIn(SL: TStrings; const S: string): Boolean; overload; function StrIndex(A: TStrA; const S: string): Integer; overload; function StrIndex(SL: TStrings; const S: string): Integer; overload; function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean; function TextAtBegin(const S, Text: string): Boolean; function TextIn(const S, Text: string): Boolean; overload; function TextIn(A: TStrA; const Text: string): Boolean; overload; function TextIn(SL: TStrings; const Text: string): Boolean; overload; function TextIndex(A: TStrA; const Text: string): Integer; overload; function TextIndex(SL: TStrings; const Text: string): Integer; overload; { Replace } function ReplaceChars(const S: string; Old, New: Char): string; overload; function ReplaceChars(const S: string; Old: TCharSet; New: Char): string; overload; function Replace(const S, Old, New: string): string; { TStrings } function SLOfFile(const FileName: string): TStringList; function ContainsEmptyLines(SL: TStrings): Boolean; procedure DeleteEmptyLines(SL: TStrings); procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//'); procedure WriteSL(Strings: TStrings; const Prefix: string = ''; const Suffix: string = ''); function FindLine(SL: TStrings; const S: string): Integer; procedure QuickSortSL(SL: TStringList); { TStrA } function IncStrA(StrA: TStrA): Integer; { TByteA } function StrOfByteA(a: TByteA): string; function ByteAOfStr(const S: string): TByteA; function ByteAOfInt(i: Integer): TByteA; function IntOfByteA(A: TByteA): Integer; function ByteAOfHex(const Hex: string): TByteA; function SameByteA(const A, B: TByteA): Boolean; function Reverse(a: TByteA): TByteA; function SaveByteA(Data: TByteA; const FileName: string; Overwrite: Boolean = True): Boolean; function LoadByteA(const FileName: string): TByteA; function Endian(i: Integer): Integer; { Files } function SizeOfFile(const FileName: string): Integer; function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean; function LWPSolve(const Dir: string): string; function LWPSlash(const Dir: string): string; function ExtractDrive(const FileName: string): string; function ExtractPath(const FileName: string): string; function ExtractPrefix(const FileName: string): string; function ExtractSuffix(const FileName: string): string; function IsValidFileName(const FileName: string): Boolean; function MakeValidFileName(FileName: string; const Default: string = 'File'): string; { Converting } function IsValidInteger(const S: string): Boolean; function IsValidCardinal(const S: string): Boolean; function StrOfBool(flag: Boolean; const TrueStr: string = 'True'; const FalseStr: string = 'False'): string; function StrOfInt(i: Integer): string; function CardOfStr(const S: string): Cardinal; function HexOrd(Hex: Char): THex; function ByteOfHex(Hex: THexByteStr): Byte; function DecOfHex(const Hex: string): string; function HexOfByte(b: Byte): THexByteStr; function HexOfCard(i: Cardinal): string; overload; function HexOfCard(i: Cardinal; Digits: Integer): string; overload; function PascalHexArray(a: TByteA; Name: string): string; function HexOfByteA(a: TByteA; Blocks: Integer = 1; const Splitter: string = ' '): string; function BinOfByteA(a: TByteA; Blocks: Integer = 4; const Splitter: string = ' '): string; function CardOfHex(Hex: string): Cardinal; function IntOfBin(Bin: string): Cardinal; function BinOfIntFill(n: cardinal; MinCount: Integer = 8): string; function BinOfInt(n: cardinal): string; function BaseNOfInt(I: Cardinal; B: TBaseN): string; function IntOfBaseN(V: string; B: TBaseN): Cardinal; { Ranges } function KeepIn(i, Bottom, Top: Variant): Variant; function InRange(Value, Bottom, Top: Variant): Boolean; function InStrictRange(Value, Bottom, Top: Variant): Boolean; function Min(const A, B: Integer): Integer; overload; function Min(const A: TIntA): Integer; overload; function Max(const A, B: Integer): Integer; overload; function Max(const A: TIntA): Integer; overload; const RangesSeparator = ','; RangeInnerSeparator = '-'; RangeInfinite = '*'; RangeSpecialChars = [RangesSeparator, RangeInnerSeparator, RangeInfinite]; function RangesOfStr(const S: string): TRanges; function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean; function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; function ExpandString(const S: string): string; { Files } procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile); procedure FileNew(const FileName: string); function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime; { FileNames } function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string; { Finding Files } function FindAll(Strings: TStrings; const Mask: string; ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile; FileReturn: TFileNameFunc = nil): Boolean; function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile): string; function FullOSInfo: string; function Win32PlatformStr: string; function Win9x: Boolean; function WinNT: Boolean; function Win2000: Boolean; function WinXP: Boolean; var MyDir: string = ''; LastSuccessRes: Integer = 0; { Backward compatibility } {$IFNDEF VER130} function SameText(const S1, S2: string): Boolean; {$ENDIF} implementation {$IFNDEF VER140} uses FileCtrl; {$ENDIF} {$IFNDEF VER130} function SameText(const S1, S2: string): Boolean; begin Result := CompareText(S1, S2) = 0; end; {$ENDIF} procedure Report(const ReportName, Text: string); var F: TextFile; FileName: string; begin FileName := MyDir + ReportName + '.rep'; Assign(F, FileName); try if not FileExists(FileName) then Rewrite(F) else Append(F); WriteLn(F, Text); finally Close(F); end; end; procedure ClearReport(const ReportName: string); var FileName: string; begin FileName := MyDir + ReportName + '.rep'; DeleteFile(FileName); end; procedure ReportFmt(const ReportName, Fmt: string; const Args: array of const); begin Report(ReportName, Format(Fmt, Args)); end; procedure GetParams(Strings: TStrings); var P: PChar; Param: string; function GetParamStr(var P: PChar; var Param: string): Boolean; var Quoted: Boolean; begin Param := ''; repeat while (P[0] <> #0) and (P[0] <= ' ') do Inc(P); Quoted := False; while P[0] <> #0 do begin if P[0] = '"' then begin Quoted := not Quoted; Inc(P); Continue; end; if (P[0] <= ' ') and not Quoted then Break; Param := Param + P[0]; Inc(P); end; until (Param <> '') or (P[0] = #0); Result := Param <> ''; end; begin Strings.Clear; P := GetCommandLine; GetParamStr(P, Param); while GetParamStr(P, Param) do Strings.Add(Param); end; function GetParams(const Separator: string = ' '): string; var SL: TStringList; begin SL := TStringList.Create; GetParams(SL); Result := Join(SL, Separator); SL.Free; end; function Switch(const Switch: string; const PrefixChars: TCharSet = SwitchChars; IgnoreCase: Boolean = True): Boolean; //= SysUtils.FindCmdLineSwitch var i: Integer; s: string; begin Result := True; for i := 1 to ParamCount do begin s := ParamStr(i); if (s <> '') and (s[1] in PrefixChars) then begin //i know that always s <> '', but this is saver s := Copy(s, 2, MaxInt); if (s = Switch) or (IgnoreCase and (0=AnsiCompareText(s, Switch))) then Exit; end; end; Result := False; end; function ParamNum(const S: string): Integer; begin for Result := 1 to ParamCount do if 0=AnsiCompareText(ParamStr(Result), S) then Exit; Result := 0; end; function ParamPrefixNum(const Prefix: string): Integer; var Len: Integer; begin Len := Length(Prefix); for Result := 1 to ParamCount do if 0=AnsiCompareText(Copy(ParamStr(Result), 1, Len), Prefix) then Exit; Result := 0; end; function Param(const S: string): Boolean; begin Result := ParamNum(S) > 0; end; function ParamPrefix(const Prefix: string): Boolean; begin Result := ParamPrefixNum(Prefix) > 0; end; function GetParam(const Prefix: string = ''; const Default: string = ''): string; var i: Integer; begin Result := Default; if Prefix = '' then begin Result := ParamStr(1); Exit; end; i := ParamPrefixNum(Prefix); if i > 0 then Result := Copy(ParamStr(i), Length(Prefix) + 1, MaxInt); end; function GetMyDir(FullPath: Boolean = False): string; var Buffer: array[0..260] of Char; begin Result := ''; SetString(Result, Buffer, GetModuleFileName(0, Buffer, SizeOf(Buffer))); if FullPath then Result := GetFileNew(Result); Result := ExtractPath(Result); end; function WinDir: string; var Res: PChar; begin Result := '\'; GetMem(Res, MAX_PATH); GetWindowsDirectory(Res, MAX_PATH); Result := Res + '\'; FreeMem(Res, MAX_PATH); end; function SysDir: string; var Res: PChar; begin Result := '\'; GetMem(Res, MAX_PATH); GetSystemDirectory(Res, MAX_PATH); Result := Res + '\'; FreeMem(Res, MAX_PATH); end; function UserName: string; var Len: Cardinal; Res: PChar; begin Result := ''; GetMem(Res, MAX_PATH); Len := MAX_PATH; GetUserName(Res, Len); Result := Res; FreeMem(Res, MAX_PATH); end; function FirstChar(const S: string): Char; begin if s = '' then Result := #0 else Result := s[1]; end; function LastChar(const S: string): Char; begin if s = '' then Result := #0 else Result := s[Length(s)]; end; function CharPos(C: Char; const S: string; Offset: Integer = 1): Integer; var MaxPosToSearch: Integer; begin Result := Offset; MaxPosToSearch := Length(S); while Result <= MaxPosToSearch do begin if S[Result] = C then Exit; Inc(Result); end; Result := 0; end; function CharPos(C: TCharSet; const S: string; Offset: Integer = 1): Integer; var MaxPosToSearch: Integer; begin Result := Offset; MaxPosToSearch := Length(S); while Result <= MaxPosToSearch do begin if S[Result] in C then Exit; Inc(Result); end; Result := 0; end; function CharPosR(C: Char; const S: string; Offset: Integer = -1): Integer; begin if Offset < 0 then Result := Length(S) + 1 - Offset else Result := Offset; if Result > Length(S) then Result := Length(S); while Result > 0 do begin if S[Result] = C then Exit; Dec(Result); end; end; function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer; var MaxPosToSearch, LenSubStr, i: Integer; begin if SubStr = '' then begin Result := 0; Exit; end; if Offset < 1 then Result := 1 else Result := Offset; LenSubStr := Length(SubStr); MaxPosToSearch := Length(S) - LenSubStr + 1; while Result <= MaxPosToSearch do begin if S[Result] = SubStr[1] then begin i := 1; while (i < LenSubStr) and (S[Result + i] = SubStr[i + 1]) do Inc(i); if i = LenSubStr then Exit; end; Inc(Result); end; Result := 0; end; function PosExText(const SubStr, S: string; Offset: Integer = 1): Integer; var MaxPosToSearch, LenSubStr, i: Integer; function SameChar(a, b: Char): Boolean; begin Result := UpCase(a) = UpCase(b) end; begin if SubStr = '' then begin Result := 0; Exit; end; if Offset < 1 then Result := 1 else Result := Offset; LenSubStr := Length(SubStr); MaxPosToSearch := Length(S) - LenSubStr + 1; while Result <= MaxPosToSearch do begin if SameChar(S[Result], SubStr[1]) then begin i := 1; while (i < LenSubStr) and (SameChar(S[Result + i], SubStr[i + 1])) do Inc(i); if i = LenSubStr then Exit; end; Inc(Result); end; Result := 0; end; function PosExAnsiText(const SubStr, S: string; Offset: Integer = 1): Integer; var MaxPosToSearch, LenSubStr, i: Integer; function SameChar(a, b: Char): Boolean; begin Result := CharLower(PChar(a)) = CharLower(PChar(b)); end; begin if SubStr = '' then begin Result := 0; Exit; end; if Offset < 1 then Result := 1 else Result := Offset; LenSubStr := Length(SubStr); MaxPosToSearch := Length(S) - LenSubStr + 1; while Result <= MaxPosToSearch do begin if SameChar(S[Result], SubStr[1]) then begin i := 1; while (i < LenSubStr) and (SameChar(S[Result + i], SubStr[i + 1])) do Inc(i); if i = LenSubStr then Exit; end; Inc(Result); end; Result := 0; end; function UntilChar(const S: string; Brake: Char): string; var p: Integer; begin p := CharPos(Brake, S); if p > 0 then Result := Copy(S, 1, p - 1) else Result := S; end; function UntilChar(const S: string; Brake: TCharSet): string; var p: Integer; begin Result := ''; p := CharPos(Brake, S); if p > 0 then Result := Copy(S, 1, p - 1) else Result := S; end; function UntilLastChar(const S: string; Brake: Char; IgnoreNoBrake: Boolean = True): string; var p: Integer; begin Result := ''; p := CharPosR(Brake, S); if p > 0 then Result := Copy(S, 1, p - 1) else if IgnoreNoBrake then Result := S; end; function FromChar(const S: string; Brake: Char): string; var p: Integer; begin Result := ''; p := CharPos(Brake, S); if p > 0 then Result := Copy(S, p + 1, Length(S) - p); end; function FromChar(const S: string; Brake: TCharSet): string; var p: Integer; begin Result := ''; p := CharPos(Brake, S); if p > 0 then Result := Copy(S, p + 1, Length(S) - p); end; function FromLastChar(const S: string; Brake: Char; IgnoreNoBrake: Boolean = False): string; var p: Integer; begin Result := ''; p := CharPosR(Brake, S); if p > 0 then Result := Copy(S, p + 1, Length(S) - p) else if IgnoreNoBrake then Result := S; end; function BetweenChars(const S: string; Start, Finish: Char; Inclusive: Boolean = False): string; var p, fin: Integer; begin Result := ''; p := CharPos(Start, S); if p = 0 then Exit; fin := CharPos(Finish, S, p + 1); if fin = 0 then Exit; if not Inclusive then begin Inc(p); Dec(fin); end; Result := Copy(S, p, fin - p + 1); end; function UntilStr(const S: string; Brake: string): string; var p: Integer; begin if Length(Brake) = 1 then begin Result := UntilChar(S, Brake[1]); Exit; end; p := PosEx(Brake, S); if p > 0 then Result := Copy(S, 1, p - 1) else Result := S; end; function FromStr(const S: string; Brake: string): string; var p: Integer; begin if Length(Brake) = 1 then begin Result := FromChar(S, Brake[1]); Exit; end; Result := ''; p := PosEx(Brake, s); if p > 0 then begin Inc(p, Length(Brake)); Result := Copy(S, p, Length(S) - p + 1); end; end; function StringWrap(const S: string; Width: Integer; const LineEnd: string = EOL): string; var i: Integer; begin Result := ''; if (S = '') or (Width < 1) then Exit; i := 1; while True do begin Result := Result + Copy(S, i, Width); Inc(i, Width); if i <= Length(S) then Result := Result + LineEnd else Exit; end; end; function Split(const S, Separator: string; IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; var p, fin, SepLen: Integer; procedure Add(const S: string); begin if IgnoreMultiSep and (S = '') then Exit; SetLength(Result, Length(Result) + 1); Result[High(Result)] := S; end; begin if S = '' then begin if Length(Result) < MinCount then SetLength(Result, MinCount); Exit; end; Result := nil; SepLen := Length(Separator); p := 1; fin := PosEx(Separator, S); while fin > 0 do begin Add(Copy(S, p, fin - p)); p := fin + SepLen; fin := PosEx(Separator, S, p); end; Add(Copy(S, p, Length(S) - p + 1)); if Length(Result) < MinCount then SetLength(Result, MinCount); end; procedure Split(const S, Separator: string; Strings: TStrings; IgnoreMultiSep: Boolean = True); var p, fin, SepLen: Integer; procedure Add(const S: string); begin if IgnoreMultiSep and (S = '') then Exit; Strings.Add(S); end; begin if S = '' then Exit; Strings.BeginUpdate; SepLen := Length(Separator); p := 1; fin := PosEx(Separator, S); while fin > 0 do begin Add(Copy(S, p, fin - p)); p := fin + SepLen; fin := PosEx(Separator, S, p); end; Add(Copy(S, p, Length(S) - p + 1)); Strings.EndUpdate; end; function Split(const S: string; Separators: TCharSet; IgnoreMultiSep: Boolean = True; MinCount: Integer = 0): TStrA; var p, fin: Integer; procedure Add(const S: string); begin if IgnoreMultiSep and (S = '') then Exit; SetLength(Result, Length(Result) + 1); Result[High(Result)] := S; end; begin if S = '' then begin if Length(Result) < MinCount then SetLength(Result, MinCount); Exit; end; Result := nil; p := 1; fin := CharPos(Separators, S); while fin > 0 do begin Add(Copy(S, p, fin - p)); p := fin + 1; fin := CharPos(Separators, S, p); end; Add(Copy(S, p, Length(S) - p + 1)); if Length(Result) < MinCount then SetLength(Result, MinCount); end; procedure TileStr(const S: string; BrakeStart: Integer; BrakeEnd: Integer; out Left, Right: string); begin Left := Copy(S, 1, BrakeStart-1); Right := Copy(S, BrakeEnd + 1, MaxInt); end; function Join(Strings: TStrings; Separator: string = ' '): string; var i, imax: Integer; begin Result := ''; imax := Strings.Count-1; for i := 0 to imax do begin Result := Result + Strings[i]; if i < imax then Result := Result + Separator; end; end; function Join(StrA: TStrA; Separator: string = ' '): string; overload; var i: Integer; begin Result := ''; for i := 0 to High(StrA) do begin Result := Result + StrA[i]; if i < High(StrA) then Result := Result + Separator; end; end; function MulStr(const S: string; Count: Integer): string; var P: PChar; Len, i: Integer; begin Result := ''; if Count = 0 then Exit; Len := Length(S); SetLength(Result, Len * Count); P := Pointer(Result); for i := 1 to Count do begin Move(Pointer(S)^, P^, Len); Inc(P, Len); end; end; function AlignR(const S: string; Width: Integer; Filler: Char = ' '): string; begin Result := MulStr(Filler, Width - Length(S)) + S; end; function MaxStr(const S: string; MaxLen: Integer): string; var Len: Integer; begin Len := Length(S); if Len <= MaxLen then begin Result := S; Exit end; Result := Copy(S, 1, MaxLen - 3) + '...'; end; function TrimAll(const S: string): string; var i: Integer; begin for i := 1 to Length(S) do if S[i] > #32 then Result := Result + S[i]; end; function ControlChar(C: Char): Boolean; begin Result := C in StrangeChars; end; function FriendlyChar(C: Char): Char; begin case C of #0: Result := '.'; #1..#31: Result := '?'; #255: Result := '#'; else Result := C; end; end; function FriendlyStr(const S: string): string; var i: Integer; begin SetLength(Result, Length(S)); for i := 1 to Length(S) do Result[i] := FriendlyChar(S[i]); end; function FriendlyStr(a: TByteA): string; var i: Integer; begin SetLength(Result, Length(a)); for i := 0 to High(a) do Result[i + 1] := FriendlyChar(Char(a[i])); end; function Quote(const S: string; Quoter: Char = '"'): string; begin Result := S; if FirstChar(S) <> Quoter then Result := Quoter + Result; if LastChar(S) <> Quoter then Result := Result + Quoter; end; function DeQuote(const S: string): string; begin Result := ''; if Length(S) > 2 then Result := Copy(S, 2, Length(S) - 2); end; function UnQuote(const S: string): string; var Start, Len: Integer; begin Start := 1; Len := Length(S); if (S <> '') and (S[1] in ([#0..#32] + QuoteChars)) then begin if (LastChar(S) = S[1]) then Dec(Len); Inc(Start); end; Result := Copy(S, Start, Len - Start + 1); end; function StrNumerus(const Value: Integer; const Singular, Plural: string; const Zero: string = '0'): string; begin if Abs(Value) = 1 then Result := IntToStr(Value) + ' ' + Singular else if Value = 0 then Result := Zero + ' ' + Plural else Result := IntToStr(Value) + ' ' + Plural; end; function MakeStr(const Items: array of const; Separator: string = ''): string; const BoolStrings: array[Boolean] of string = ('False', 'True'); var i: Integer; function StrOfP(P: Pointer): string; begin if P = nil then Result := '[nil]' else Result := '[' + IntToStr(Cardinal(P)) + ']'; end; procedure Add(const S: string); begin Result := Result + s + Separator; end; begin Result := ''; for i := 0 to High(Items) do with Items[i] do case VType of vtString: Add(VString^); vtInteger: Add(IntToStr(VInteger)); vtBoolean: Add(BoolStrings[VBoolean]); vtChar: Add(VChar); vtPChar: Add(VPChar); vtExtended: Add(FloatToStr(VExtended^)); vtObject: if VObject is TComponent then Add(TComponent(VObject).Name) else Add(VObject.ClassName); vtClass: Add(VClass.ClassName); vtAnsiString: Add(string(VAnsiString)); vtCurrency: Add(CurrToStr(VCurrency^)); vtInt64: Add(IntToStr(VInt64^)); vtVariant: Add(string(VVariant^)); vtWideChar: Add(VWideChar); vtPWideChar: Add(VPWideChar); vtInterface: Add(StrOfP(VInterface)); vtPointer: Add(StrOfP(VPointer)); vtWideString: Add(WideString(VWideString)); end; if Result <> '' then SetLength(result, Length(Result) - Length(Separator)); end; procedure ShowText(const Items: array of const; Separator: string = ''); var Text: string; begin Text := MakeStr(Items, Separator); MessageBox(0, PChar(Text), 'Info', MB_OK and MB_APPLMODAL); end; function DeleteChars(const S: string; C: Char): string; var i: Integer; begin Result := ''; for i := 1 to Length(S) do if S[i] <> C then Result := Result + S[i]; end; function DeleteChars(const S: string; C: TCharSet): string; var i: Integer; begin Result := ''; for i := 1 to Length(S) do if not (S[i] in C) then Result := Result + S[i]; end; function ExtractChars(const S: string; C: TCharSet): string; var i: Integer; begin Result := ''; for i := 1 to Length(S) do if S[i] in C then Result := Result + S[i]; end; function CharCount(const S: string; C: Char): Integer; var i: Integer; begin Result := 0; for i := 1 to Length(S) do if S[i] = C then Inc(Result); end; function StrAtPos(const S: string; Pos: Integer; const Str: string): Boolean; begin Result := (Str <> '') and (Str = Copy(S, Pos, Length(Str))); end; function TextAtPos(const S: string; Pos: Integer; const Text: string): Boolean; begin Result := (Text <> '') and SameText(Text, Copy(S, Pos, Length(Text))); end; function StrAtBegin(const S, Str: string): Boolean; begin Result := StrAtPos(S, 1, Str); end; function TextAtBegin(const S, Text: string): Boolean; begin Result := TextAtPos(S, 1, Text); end; function CharIn(const S: string; C: Char): Boolean; var i: Integer; begin Result := True; for i := 1 to Length(S) do if S[i] = C then Exit; Result := False; end; function CharIn(const S: string; C: TCharSet): Boolean; var i: Integer; begin Result := False; for i := 1 to Length(S) do begin Result := S[i] in C; if Result then Exit; end; end; function StrIn(const S, SubStr: string): Boolean; begin Result := PosEx(SubStr, S) > 0; end; function StrIn(SL: TStrings; const S: string): Boolean; var i: Integer; begin Result := False; for i := 0 to SL.Count-1 do begin Result := (S = SL[i]); if Result then Exit; end; end; function StrIn(A: TStrA; const S: string): Boolean; var i: Integer; begin Result := False; for i := Low(A) to High(A) do begin Result := (S = A[i]); if Result then Exit; end; end; function TextIn(const S, Text: string): Boolean; begin Result := PosExText(Text, S) > 0; end; function TextIn(SL: TStrings; const Text: string): Boolean; var i: Integer; begin Result := False; for i := 0 to SL.Count-1 do begin Result := SameText(Text, SL[i]); if Result then Exit; end; end; function TextIn(A: TStrA; const Text: string): Boolean; var i: Integer; begin Result := False; for i := Low(A) to High(A) do begin Result := SameText(Text, A[i]); if Result then Exit; end; end; function StrIndex(SL: TStrings; const S: string): Integer; begin for Result := 0 to SL.Count-1 do if S = SL[Result] then Exit; Result := -1; end; function StrIndex(A: TStrA; const S: string): Integer; begin for Result := Low(A) to High(A) do if S = A[Result] then Exit; Result := -1; end; function TextIndex(SL: TStrings; const Text: string): Integer; begin for Result := 0 to SL.Count-1 do if SameText(Text, SL[Result]) then Exit; Result := -1; end; function TextIndex(A: TStrA; const Text: string): Integer; begin for Result := Low(A) to High(A) do if SameText(Text, A[Result]) then Exit; Result := -1; end; function ReplaceChars(const S: string; Old, New: Char): string; var i: Integer; begin Result := S; for i := 1 to Length(Result) do if Result[i] = Old then Result[i] := New; end; function ReplaceChars(const S: string; Old: TCharSet; New: Char): string; var i: Integer; begin Result := S; for i := 1 to Length(Result) do if Result[i] in Old then Result[i] := New; end; function Replace(const S, Old, New: string): string; var oldp, ps: Integer; begin ps := 1; Result := ''; while True do begin oldp := ps; ps := PosEx(Old, S, oldp); if ps = 0 then begin Result := Result + Copy(S, oldp, Length(S) - oldp + 1); Exit; end; Result := Result + Copy(S, oldp, ps - oldp) + New; Inc(ps, Length(Old)); end; end; function SLOfFile(const FileName: string): TStringList; begin Result := TStringList.Create; if FileExists(FileName) then Result.LoadFromFile(FileName); end; function ContainsEmptyLines(SL: TStrings): Boolean; begin Result := StrIn(SL, ''); end; procedure DeleteEmptyLines(SL: TStrings); var i: Integer; begin i := 0; while i < SL.Count do begin if SL[i] = '' then SL.Delete(i) else Inc(i); end; end; procedure DeleteCommentLines(SL: TStrings; const CommentSign: string = '//'); var i: Integer; begin i := 0; while i < SL.Count do begin if (SL[i] = '') or (StrAtBegin(TrimLeft(SL[i]), CommentSign)) then SL.Delete(i) else Inc(i); end; end; function FindLine(SL: TStrings; const S: string): Integer; begin for Result := 0 to SL.Count-1 do if TextAtBegin(SL[Result], S) then Exit; Result := -1; end; procedure QuickSortSL(SL: TStringList); procedure Sort(l, r: Integer); var i,j: Integer; z,x: string; begin i := l; j := r; x := SL[(j + i) div 2]; repeat while SL[i] < x do Inc(i); while SL[j] > x do Dec(j); if i <= j then begin z := SL[i]; SL[i] := SL[j]; SL[j] := z; Inc(i); Dec(j); end; until i > j; if j > l then Sort(l, j); if i < r then Sort(i, r); end; begin if SL.Count > 0 then Sort(0, SL.Count-1); end; function IncStrA(StrA: TStrA): Integer; begin SetLength(StrA, Length(StrA) + 1); Result := High(StrA); end; function StrOfByteA(a: TByteA): string; begin Result := string(Copy(a, 0, Length(a))); end; function ByteAOfStr(const S: string): TByteA; begin Result := TByteA(Copy(S, 1, Length(s))); end; function ByteAOfInt(i: Integer): TByteA; begin SetLength(Result, SizeOf(Integer)); Move(i, Pointer(Result)^, SizeOf(Integer)); end; function IntOfByteA(A: TByteA): Integer; begin Result := 0; Move(Pointer(A)^, Result, Min(Length(A), SizeOf(Integer))); end; function ByteAOfHex(const Hex: string): TByteA; var i: Integer; h: string; begin h := ExtractChars(Hex, HexadecimalChars); SetLength(Result, Length(h) div 2); for i := 0 to High(Result) do Result[i] := ByteOfHex(Copy(h, (i shl 1) + 1, 2)); end; function SizeOfFile(const FileName: string): Integer; var F: file; begin AssignFile(F, FileName); {$I-}Reset(F, 1);{$I+} if IOResult = 0 then begin Result := FileSize(F); CloseFile(F); end else Result := 0; end; function FileEx(const FileName: string; AllowFolders: Boolean = False): Boolean; var FindData: TWin32FindData; begin if FileName = '' then begin Result := False; Exit; end; Result := (AllowFolders and DirectoryExists(FileName)) or (FindFirstFile(PChar(FileName), FindData) <> INVALID_HANDLE_VALUE); Result := Result and not CharIn(FileName, WildCards); Result := Result and (AllowFolders or ((FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0)); end; function LWPSolve(const Dir: string): string; begin if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin Result := Copy(Dir, 1, Length(Dir) - 1); end else Result := Dir; end; function LWPSlash(const Dir: string): string; begin if (Dir <> '') and (Dir[Length(Dir)] = '\') then begin Result := Copy(Dir, 1, Length(Dir)); end else Result := Dir + '\'; end; function ExtractDrive(const FileName: string): string; begin Result := ''; if (Length(FileName) >= 2) and (FileName[2] = ':') then Result := UpperCase(FileName[1] + ':\'); end; function ExtractPath(const FileName: string): string; var p: Integer; begin p := CharPosR('\', FileName); if P > 0 then Result := Copy(FileName, 1, p) else Result := FileName; end; function ExtractPrefix(const FileName: string): string; begin Result := UntilLastChar(ExtractFileName(FileName), '.'); end; function ExtractSuffix(const FileName: string): string; begin Result := FromLastChar(ExtractFileName(FileName), '.'); end; function SameByteA(const A, B: TByteA): Boolean; begin Result := (A = B) or ((Length(A) = Length(B)) and CompareMem(A, B, Length(A))); end; function Reverse(A: TByteA): TByteA; var i: Integer; begin SetLength(Result, Length(A)); for i := 0 to High(A) do Result[High(Result) - i] := A[i]; end; function Endian(i: Integer): Integer; type EndianArray = packed array[0..3] of Byte; var a, b: EndianArray; begin a := EndianArray(i); b[0] := a[3]; b[1] := a[2]; b[2] := a[1]; b[3] := a[0]; Result := Integer(b); end; function SaveByteA(Data: TByteA; const FileName: string; Overwrite: Boolean = True): Boolean; var F: file; begin if FileExists(FileName) and not Overwrite then begin Result := False; Exit end; AssignFile(F, FileName); {$I-}Rewrite(F, 1);{$I+} if IOResult = 0 then begin if Length(Data) > 0 then BlockWrite(F, Data[0], Length(Data)); CloseFile(F); Result := True; end else Result := False; end; function LoadByteA(const FileName: string): TByteA; var F: file; begin AssignFile(F, FileName); {$I-}Reset(F, 1);{$I+} if IOResult = 0 then begin SetLength(Result, FileSize(F)); if Length(Result) > 0 then BlockRead(F, Result[0], FileSize(F)); CloseFile(F); end else SetLength(Result, 0); end; function IsValidFileName(const FileName: string): Boolean; begin Result := (FileName <> '') and not CharIn(FileName, FileNameEnemies) and CharIn(Trim(FileName), AllChars - ['.']); end; function MakeValidFileName(FileName: string; const Default: string = 'File'): string; begin if FileName = '' then FileName := Default; if CharIn(FileName, FileNameEnemies) then Result := ReplaceChars(FileName, FileNameEnemies, '_') else if not CharIn(Trim(FileName), AllChars - ['.']) then Result := Default else Result := FileName; end; function IsValidInteger(const S: string): Boolean; {const LowInt = '2147483648'; HighInt = '2147483647'; var len, RealLen, i, o: Integer; c: Char; begin Result := False; if S = '' then Exit; len := Length(S); o := 1; if S[1] = '-' then begin if len = 1 then Exit; Inc(o); while (o <= len) and (S[o] = '0') do Inc(o); if o > len then Exit; if o < len then begin RealLen := len - o + 1; if RealLen > Length(LowInt) then Exit else if RealLen = Length(LowInt) then begin for i := 1 to Length(LowInt) do begin c := S[i + o - 1]; if (c < '0') or (c > LowInt[i]) then Exit; if c in ['0'..Char((Byte(LowInt[i])-1))] then Break; end; Inc(o, i); end; end; end else begin while (o <= len) and (S[o] = '0') do Inc(o); if o <= len then begin RealLen := len - o + 1; if RealLen > Length(HighInt) then Exit else if RealLen = Length(HighInt) then begin for i := 1 to Length(HighInt) do begin c := S[i + o - 1]; if (c < '0') or (c > HighInt[i]) then Exit; if c in ['0'..Char((Byte(HighInt[i])-1))] then Break; end; Inc(o, i); end; end; end; for i := o to len do if not (S[i] in ['0'..'9']) then Exit; Result := True; } var i: Int64; begin i := StrToInt64Def(S, High(Int64)); Result := (i >= Low(Integer)) and (i <= High(Integer)); end; function IsValidCardinal(const S: string): Boolean; {const HighCard = '4294967295'; var len, RealLen, i, o: Integer; begin Result := False; if S = '' then Exit; len := Length(S); o := 1; while (o <= len) and (S[o] = '0') do Inc(o); if o <= len then begin RealLen := len - o + 1; if RealLen > Length(HighCard) then Exit else if RealLen = Length(HighCard) then begin for i := 1 to Length(HighCard) do begin if S[i + o - 1] > HighCard[i] then Exit; if S[i + o - 1] in ['0'..Char((Byte(HighCard[i])-1))] then Break; end; Inc(o, i); end; end; for i := o to len do if not (S[i] in ['0'..'9']) then Exit; Result := True; } var i: Int64; begin i := StrToInt64Def(S, -1); Result := (i >= 0) and (i <= High(Cardinal)); end; function StrOfBool(flag: Boolean; const TrueStr: string = 'True'; const FalseStr: string = 'False'): string; begin if Flag then Result := TrueStr else Result := FalseStr; end; function StrOfInt(i: Integer): string; begin { if i = 0 then begin Result := '0'; Exit end; while i > 0 do begin Result := Char(Byte('0') + (i mod 10)) + Result; i := i div 10; end;} Result := IntToStr(i); end; function CardOfStr(const S: string): Cardinal; var Res: Int64; begin Res := StrToInt64Def(S, -1); if Res > High(Cardinal) then Res := High(Cardinal) else if Res < 0 then Res := 0; Result := Cardinal(Res); end; function HexOrd(Hex: Char): THex; begin case Hex of '0'..'9': Result := Byte(Hex) - 48; 'A'..'F': Result := Byte(Hex) - 55; 'a'..'f': Result := Byte(Hex) - 87; else Result := 0; end; end; function ByteOfHex(Hex: THexByteStr): Byte; begin Result := (HexOrd(Hex[1]) shl 4) + HexOrd(Hex[2]); end; function DecOfHex(const Hex: string): string; begin Result := IntToStr(CardOfHex(Hex)); end; function HexOfByte(b: Byte): THexByteStr; begin Result := HexChar[(b and $F0) shr 4] + HexChar[ b and $0F ]; end; {function HexOfCard2(c: Cardinal): string; var Data: array[0..(1 shl 4) - 1] of Char; i: Integer; begin for i := 0 to (1 shl 4) - 1 do if i < 10 then Data[i] := Char(Ord('0') + i) else Data[i] := Char(Ord('A') + i - 10); Result := Data[(c and (((1 shl (1 shl 2)) - 1) shl (7 shl 2))) shr (7 shl 2)] + Data[(c and (((1 shl (1 shl 2)) - 1) shl (6 shl 2))) shr (6 shl 2)] + Data[(c and (((1 shl (1 shl 2)) - 1) shl (5 shl 2))) shr (5 shl 2)] + Data[(c and (((1 shl (1 shl 2)) - 1) shl (4 shl 2))) shr (4 shl 2)] + Data[(c and (((1 shl (1 shl 2)) - 1) shl (3 shl 2))) shr (3 shl 2)] + Data[(c and (((1 shl (1 shl 2)) - 1) shl (2 shl 2))) shr (2 shl 2)] + Data[(c and (((1 shl (1 shl 2)) - 1) shl (1 shl 2))) shr (1 shl 2)] + Data[(c and (((1 shl (1 shl 2)) - 1) shl (0 shl 2))) shr (0 shl 2)]; end; } function HexOfCard(i: Cardinal): string; var a: Cardinal; begin Result := ''; while i > 0 do begin a := i and $F; Result := HexChar[a] + Result; i := i shr 4; end; end; function HexOfCard(i: Cardinal; Digits: Integer): string; var a: Cardinal; begin Result := ''; while i > 0 do begin a := i and $F; Result := HexChar[a] + Result; i := i shr 4; end; Result := MulStr('0', Digits - Length(Result)) + Result; end; function PascalHexArray(a: TByteA; Name: string): string; var i, len: Integer; begin Result := 'const' + EOL + ' ' + Name + ': array[0..' + IntToStr(High(a)) + '] of Byte = ('; len := Length(a); for i := 0 to len-1 do begin if (i mod 19) = 0 then Result := Result + EOL + ' ' + ' '; Result := Result + '$' + HexOfByte(a[i]); if i < len-1 then Result := Result + ','; end; Result := Result + EOL + ' );'; end; function HexOfByteA(a: TByteA; Blocks: Integer = 1; const Splitter: string = ' '): string; var i: Integer; begin Result := ''; if Blocks > 0 then for i := 0 to High(a) do begin Result := Result + HexOfByte(a[i]); if i < High(a) then if ((i+1) mod Blocks) = 0 then Result := Result + Splitter; end else for i := 0 to High(a) do Result := Result + HexOfByte(a[i]); end; function BinOfByteA(a: TByteA; Blocks: Integer = 4; const Splitter: string = ' '): string; var i, max: Integer; Bit: Boolean; begin Result := ''; if Blocks > 0 then begin max := 8 * (High(a)) + 7; for i := 0 to max do begin Bit := 7-(i mod 8) in TBitSet(a[i div 8]); Result := Result + Char(Byte('0') + Byte(Bit)); if i < max then if ((i+1) mod Blocks) = 0 then Result := Result + Splitter; end; end else for i := 0 to High(a) do Result := Result + Char(Byte('0') + a[i] shr (i and 8)); end; function CardOfHex(Hex: string): Cardinal; var i: Integer; begin Result := 0; Hex := Copy(ExtractChars(Hex, HexadecimalChars), 1, 8); for i := 1 to Length(Hex) do if Hex[i] <> '0' then Inc(Result, HexOrd(Hex[i]) shl ((Length(Hex) - i) shl 2)); end; function IntOfBin(Bin: string): Cardinal; var i: Integer; begin Result := 0; Bin := Copy(ExtractChars(Bin, BinaryChars), 1, 32); for i := Length(Bin) downto 1 do if Bin[i] = '1' then Inc(Result, 1 shl (Length(Bin) - i)); end; function BinOfInt(n: Cardinal): string; var a: Integer; begin if n = 0 then begin Result := '0'; exit; end; Result := ''; while n > 0 do begin a := n and 1; Result := Char(a + Byte('0')) + Result; n := n shr 1; end; end; function BinOfIntFill(n: Cardinal; MinCount: Integer = 8): string; var a: Integer; begin if n = 0 then begin Result := MulStr('0', MinCount); Exit; end; Result := ''; while n > 0 do begin a := n and 1; Result := Char(a + Byte('0')) + Result; n := n shr 1; end; Result := MulStr('0', MinCount - Length(Result)) + Result; end; function BaseNOfInt(I: Cardinal; B: TBaseN): string; var a: Integer; begin if (B < 2) or (i = 0) then begin Result := '0'; Exit; end; Result := ''; while i > 0 do begin a := i mod B; Result := BaseNChar[a] + Result; i := i div B; end; end; function IntOfBaseN(V: string; B: TBaseN): Cardinal; var i: Integer; F: Cardinal; c: Byte; begin Result := 0; V := TrimAll(V); F := 1; for i := Length(V) downto 1 do begin c := Byte(UpCase(V[i])); case Char(c) of '0'..'9': c := c - 48; 'A'..'Z': c := c - 55; end; if c < B then Result := Result + Byte(c) * F; F := F * B; end; end; function KeepIn(i, Bottom, Top: Variant): Variant; begin Result := i; if Result > Top then Result := Top else if Result < Bottom then Result := Bottom; end; function InRange(Value, Bottom, Top: Variant): Boolean; begin Result := (Value >= Bottom) and (Value <= Top); end; function InStrictRange(Value, Bottom, Top: Variant): Boolean; begin Result := (Value > Bottom) and (Value < Top); end; function Min(const A, B: Integer): Integer; begin if A < B then Result := A else Result := B; end; function Min(const A: TIntA): Integer; var i: Integer; begin Result := 0; if Length(A) = 0 then Exit; Result := A[0]; for i := 1 to High(A) do if A[i] < Result then Result := A[i]; end; function Max(const A, B: Integer): Integer; begin if A > B then Result := A else Result := B; end; function Max(const A: TIntA): Integer; var i: Integer; begin Result := 0; if Length(A) = 0 then Exit; Result := A[0]; for i := 1 to High(A) do if A[i] > Result then Result := A[i]; end; function RangesOfStr(const S: string): TRanges; var SL: TStringList; r, b, t: string; i, p: Integer; function TryStrToCard(const S: string; out Value: Cardinal): Boolean; var E: Integer; begin Val(S, Value, E); Result := E = 0; end; begin Result := nil; SL := TStringList.Create; try Split(S, RangesSeparator, SL); SetLength(Result, SL.Count); for i := 0 to SL.Count-1 do begin r := SL[i]; with Result[i] do begin p := CharPos(RangeInnerSeparator, r); Simple := p = 0; // no '-' found if Simple then begin if r = RangeInfinite then begin // * --> *-* Simple := False; Bottom := Low(Bottom); Top := High(Top); end else if not TryStrToCard(r, Value) then Break; end else begin TileStr(r, p, p, b, t); if b = RangeInfinite then Bottom := Low(Bottom) else if not TryStrToCard(b, Bottom) then Break; if t = RangeInfinite then Top := High(Top) else if not TryStrToCard(t, Top) then Break; if Bottom > Top then begin p := Bottom; Bottom := Top; Top := p; end; end; end; end; if i <> SL.Count then Result := nil; finally SL.Free; end; end; function InRanges(Ranges: TRanges; TestValue: Cardinal): Boolean; var i: Integer; begin Result := True; for i := 0 to High(Ranges) do with Ranges[i] do if Simple then begin if TestValue = Value then Exit; end else begin if InRange(TestValue, Bottom, Top) then Exit; end; Result := False; end; procedure WriteSL(Strings: TStrings; const Prefix: string = ''; const Suffix: string = ''); var i: Integer; begin for i := 0 to Strings.Count-1 do WriteLn(Prefix + Strings[i] + Suffix); end; function Success(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; begin Result := (Res = ResultOnSuccess); LastSuccessRes := Res; end; function Failure(Res: Integer; ResultOnSuccess: Integer = ERROR_SUCCESS): Boolean; begin Result := not Success(Res, ResultOnSuccess); end; function ExpandString(const S: string): string; var Len: Integer; P, Res: PChar; begin Result := ''; P := PChar(S); Len := ExpandEnvironmentStrings(P, nil, 0); if Len = 0 then Exit; GetMem(Res, Len); ExpandEnvironmentStrings(P, Res, Len); Result := Res; FreeMem(Res, Len); end; function FindAll(Strings: TStrings; const Mask: string; ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile; FileReturn: TFileNameFunc = nil): Boolean; var Path, FileName: string; procedure ScanDir(const Path, FileName: string); var PSR: TSearchRec; Res: Integer; procedure Add(const S: string); begin if S <> '' then Strings.Add(S); end; begin Res := FindFirst(Path + FileName, Attributes, PSR); while Success(Res, 0) do begin if Assigned(FileReturn) then Add(FileReturn(Path + PSR.Name)) else Add(Path + PSR.Name); Res := FindNext(PSR); end; FindClose(PSR); if not ScanSubDirs then Exit; Res := FindFirst(Path + '*', faDirectory, PSR); while Success(Res, 0) do begin if (PSR.Attr and faDirectory > 0) and (PSR.Name <> '.') and (PSR.Name <> '..') then ScanDir(Path + PSR.Name + '\', FileName); Res := FindNext(PSR); end; FindClose(PSR); end; begin Strings.Clear; Path := ExtractPath(Mask); FileName := ExtractFileName(Mask); ScanDir(Path, FileName); Result := Strings.Count > 0; end; function FindAllFirst(const Mask: string; ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile): string; var Path, FileName: string; function ScanDir(const Path, FileName: string): Boolean; var PSR: TSearchRec; Res: Integer; begin Result := False; if Success(FindFirst(Path + FileName, Attributes, PSR), 0) then begin FindAllFirst := Path + PSR.Name; Result := True; FindClose(PSR); Exit; end; if not ScanSubDirs then Exit; Res := FindFirst(Path + '*', faDirectory, PSR); while not Result and Success(Res, 0) do begin if (PSR.Attr and faDirectory > 0) and (PSR.Name <> '.') and (PSR.Name <> '..') then Result := ScanDir(Path + PSR.Name + '\', FileName); Res := FindNext(PSR); end; FindClose(PSR); end; begin Result := ''; Path := ExtractPath(Mask); FileName := ExtractFileName(Mask); ScanDir(Path, FileName); end; procedure DeleteFiles(const Mask: string; ScanSubDirs: Boolean = True; Attributes: Integer = faFindEveryFile); var Path, FileName: string; procedure ScanDir(const Path, FileName: string); var PSR: TSearchRec; Res: Integer; procedure TryDeleteFile(const FileName: string); begin try DeleteFile(Path + PSR.Name); except end; end; begin Res := FindFirst(Path + FileName, Attributes, PSR); while Success(Res, 0) do begin TryDeleteFile(Path + PSR.Name); Res := FindNext(PSR); end; FindClose(PSR); if not ScanSubDirs then Exit; Res := FindFirst(Path + '*', faDirectory, PSR); while Success(Res, 0) do begin if (PSR.Attr and faDirectory > 0) and (PSR.Name <> '.') and (PSR.Name <> '..') then begin ScanDir(Path + PSR.Name + '\', FileName); TryDeleteFile(Path + PSR.Name); end; Res := FindNext(PSR); end; FindClose(PSR); end; begin Path := ExtractPath(Mask); FileName := ExtractFileName(Mask); ScanDir(Path, FileName); end; function GetFileNew(FileName: string; NoFloppyDrives: Boolean = True): string; var Drive: string; pf, pd, Len: Integer; PSR: TSearchRec; begin Result := ''; FileName := Trim(FileName); if Length(FileName) < 2 then Exit; Drive := ExtractDrive(FileName); if not DirectoryExists(Drive) then Exit; if NoFloppyDrives and (Drive[1] in ['A', 'B']) then Exit; Len := Length(FileName); Result := Drive; pf := Length(Drive) + 1; while pf <= Len do begin if FileName[pf] = '\' then begin Result := Result + '\'; Inc(pf); Continue; end; pd := CharPos('\', FileName, pf); if pd = 0 then begin if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faFindEveryFile, PSR) then begin Result := Result + PSR.Name; Break; end else begin FindClose(PSR); if 0=FindFirst(Result + Copy(FileName, pf, MaxInt), faDirectory, PSR) then Result := Result + PSR.Name + '\' else Result := ''; FindClose(PSR); if Result = '' then Break; end; end; if 0=FindFirst(Result + Copy(FileName, pf, pd - pf), faDirectory, PSR) then Result := Result + PSR.Name + '\' else Result := ''; FindClose(PSR); if Result = '' then Break; pf := pd + 1; end; if (Result <> '') and not FileEx(Result, True) then Result := ''; end; function DateTimeOfFileTime(const FileTime: TFileTime): TDateTime; var LocalFileTime: TFileTime; Res: Integer; begin Result := 0; FileTimeToLocalFileTime(FileTime, LocalFileTime); if not FileTimeToDosDateTime(LocalFileTime, LongRec(Res).Hi, LongRec(Res).Lo) then Res := -1; if (Res = -1) or (Res = 0) then Exit; try Result := FileDateToDateTime(Res); except end; end; procedure FileNew(const FileName: string); var Handle: Integer; begin Handle := FileCreate(FileName); FileClose(Handle); end; function Win32PlatformStr: string; const PlatformStrings: array[VER_PLATFORM_WIN32s..VER_PLATFORM_WIN32_NT] of string = ('VER_PLATFORM_WIN32s', 'VER_PLATFORM_WIN32_WINDOWS', 'VER_PLATFORM_WIN32_NT'); begin Result := PlatformStrings[Win32Platform]; end; function FullOSInfo: string; begin Result := Format( 'Platform: %s' + EOL + 'Version: %d.%d Build %d' + EOL + 'CSD: %s', [ Win32PlatformStr, Win32MajorVersion, Win32MinorVersion, Win32BuildNumber, Win32CSDVersion ] ); end; function Win9x: Boolean; begin Result := Win32Platform = VER_PLATFORM_WIN32_WINDOWS; end; function WinNT: Boolean; begin Result := Win32Platform = VER_PLATFORM_WIN32_NT; end; function Win2000: Boolean; begin Result := (Win32Platform = VER_PLATFORM_WIN32_NT) and (Win32MajorVersion = 4); end; function WinXP: Boolean; begin Result := Win32MajorVersion >= 5; end; initialization MyDir := GetMyDir; end. unit FifoStream; interface uses Classes, windows, Dialogs; const DefaultChunksize = 32768; // 32kb per chunk as default. type PMemChunk = ^TMemChunk; TMemChunk = record Filled: Longword; Read: Longword; Data: pointer; end; TFifo = class private FBuffers: TList; FChunksize: Longword; FCritSect: TRTLCriticalSection; FIsWinNT: boolean; FBytesInFifo: LongWord; protected function GetBytesInFifo: LongWord; public constructor Create; destructor Destroy; override; procedure Write(Data: pointer; Size: LongWord); procedure Read(Buff: pointer; var ReqSize: LongWord); procedure PeekData(Buff: pointer; var ReqSize: LongWord); published property BytesInFifo: LongWord read FBytesInFifo; end; implementation constructor TFifo.Create; begin inherited; FBuffers := TList.Create; // set default chunksize... FChunksize := DefaultChunksize; InitializeCriticalSection(FCritSect); end; destructor TFifo.Destroy; var I: Integer; begin EnterCriticalSection(FCritSect); for I := 0 to FBuffers.count - 1 do begin FreeMem(PMemChunk(Fbuffers[I]).Data); Dispose(PMemChunk(Fbuffers[I])); end; FBuffers.Clear; FBuffers.Free; LeaveCriticalSection(FCritSect); DeleteCriticalSection(FCritSect); inherited; end; function TFifo.GetBytesInFifo: LongWord; begin Result := 0; if FBuffers.Count = 0 then begin exit; end else begin if FBuffers.Count > 1 then Inc(Result, (FBuffers.Count - 1) * FChunkSize); Inc(Result, PMemChunk(FBuffers[Fbuffers.Count - 1]).Filled); Dec(Result, PMemChunk(FBuffers[0]).Read); end; end; procedure TFifo.Write(Data: pointer; Size: LongWord); var Privpointer: pointer; PrivSize: LongWord; Chunk: PMemChunk; PosInChunk: pointer; begin if LongWord(Data) = 0 then begin // null pointer? somebody is trying to fool us, get out... Exit; end; EnterCriticalSection(FCritSect); PrivPointer := Data; PrivSize := 0; // are already buffers there? if FBuffers.count > 0 then begin // is the last one of them not completely filled? if PMemChunk(FBuffers[FBuffers.count - 1]).filled < FChunksize then // not completely filled, so fill up the buffer. begin Chunk := PMemChunk(FBuffers[FBuffers.count - 1]); // fetch chunkdata. PosInChunk := Chunk.Data; // move to current fill pos... Inc(LongWord(PosInChunk), Chunk.Filled); // can we fill the chunk completely? if Size > FChunksize - Chunk.Filled then begin // yes we can. Move(PrivPointer^, PosInChunk^, FChunksize - Chunk.Filled); Inc(PrivSize, FChunksize - Chunk.Filled); Inc(LongWord(PrivPointer), FChunksize - Chunk.Filled); Chunk.Filled := FChunkSize; end else // we have to less data for filling the chunk completely, // just put everything in. begin Move(PrivPointer^, PosInChunk^, Size); Inc(PrivSize, Size); Inc(Chunk.Filled, Size); end; end; end; // as long as we have remaining stuff put it into new chunks. while (PrivSize < Size) do begin new(Chunk); GetMem(Chunk.Data, FChunksize); Chunk.Read := 0; // can we fill an entire chunk with the remaining data? if Privsize + FChunksize < Size then begin // yes we can, so put the stuff in. Move(Privpointer^, Chunk.Data^, FChunksize); Inc(LongWord(PrivPointer), FChunksize); Inc(PrivSize, FChunksize); Chunk.Filled := FChunksize; end else // we have to less data to fill the entire chunk, just put the remaining stuff in. begin Move(Privpointer^, Chunk.Data^, Size - Privsize); Chunk.Filled := Size - Privsize; Inc(PrivSize, Size - Privsize); end; Fbuffers.Add(Chunk); end; if Size <> Privsize then Showmessage('miscalculation in TFifo.write'); FBytesInFifo := GetBytesInFifo; LeaveCriticalSection(FCritSect); end; procedure TFifo.Read(Buff: pointer; var ReqSize: LongWord); var PrivSize: Integer; Privpos: pointer; Chunk: PMemChunk; ChunkPos: pointer; begin if LongWord(Buff) = 0 then begin // null pointer? somebody is trying to fool us, get out... Exit; end; EnterCriticalSection(FCritSect); PrivSize := 0; Privpos := Buff; while FBuffers.Count > 0 do begin Chunk := PMemChunk(FBuffers[0]); ChunkPos := Chunk.data; Inc(LongWord(ChunkPos), Chunk.Read); // does the remaining part of the chunk fit into the buffer? if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then begin // yep, it fits Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read); Inc(PrivSize, Chunk.Filled - Chunk.read); FreeMem(Chunk.Data); Dispose(Chunk); FBuffers.Delete(0); end else // remaining part didn't fit, get as much as we can and increment the // read attribute. begin Move(ChunkPos^, Privpos^, ReqSize - PrivSize); Inc(Chunk.read, ReqSize - PrivSize); Inc(PrivSize, ReqSize - PrivSize); // as we filled the buffer, we'll have to break here. break; end; end; FBytesInFifo := GetBytesInFifo; LeaveCriticalSection(FCritSect); ReqSize := PrivSize; end; // read Data from Stream without removing it from the Stream... procedure TFifo.PeekData(Buff: pointer; var ReqSize: LongWord); var PrivSize: Integer; Privpos: pointer; Chunk: PMemChunk; ChunkPos: pointer; ChunkNr: Integer; begin if LongWord(Buff) = 0 then begin // null pointer? somebody is trying to fool us, get out... Exit; end; EnterCriticalSection(FCritSect); PrivSize := 0; Privpos := Buff; ChunkNr := 0; while FBuffers.Count > ChunkNr do begin Chunk := PMemChunk(FBuffers[ChunkNr]); ChunkPos := Chunk.data; Inc(LongWord(ChunkPos), Chunk.Read); // does the remaining part of the chunk fit into the buffer? if PrivSize + (Chunk.Filled - Chunk.read) < ReqSize then begin // yep, it fits Move(ChunkPos^, Privpos^, Chunk.Filled - Chunk.read); Inc(PrivSize, Chunk.Filled - Chunk.read); Inc(ChunkNr); end else // remaining part didn't fit, get as much as we can and increment the // read attribute. begin Move(ChunkPos^, Privpos^, ReqSize - PrivSize); Inc(PrivSize, ReqSize - PrivSize); // as we filled the buffer, we'll have to break here. break; end; end; LeaveCriticalSection(FCritSect); ReqSize := PrivSize; end; end. ---tokens--- '// vim:ft=pascal' Comment.Single '\n\n' Text 'unit' Keyword ' ' Text 'YTools' Name ';' Operator '\n\n' Text '{===============================================================================\n\n cYcnus.YTools 1.0.3 Beta for Delphi 4+\n by licenser and Murphy\n\n ©2000-2003 by cYcnus\n visit www.cYcnus.de\n\n licenser@cYcnus.de (Heinz N. Gies)\n murphy@cYcnus.de (Kornelius Kalnbach)\n \n this unit is published under the terms of the GPL\n\n===============================================================================}' Comment.Multiline '\n\n' Text 'interface' Keyword '\n\n' Text 'uses' Keyword '\n ' Text 'Windows' Name ',' Operator ' ' Text 'SysUtils' Name ',' Operator ' ' Text 'Classes' Name ',' Operator ' ' Text 'YTypes' Name ';' Operator '\n\n' Text 'const' Keyword '\n ' Text 'BackSpace' Name ' ' Text '=' Operator ' ' Text '#8' Literal.String.Char ';' Operator '\n ' Text 'Tab' Name ' ' Text '=' Operator ' ' Text '#9' Literal.String.Char ';' Operator '\n ' Text 'LF' Name ' ' Text '=' Operator ' ' Text '#10' Literal.String.Char ';' Operator ' ' Text '//Line Feed' Comment.Single '\n ' Text 'CR' Name ' ' Text '=' Operator ' ' Text '#13' Literal.String.Char ';' Operator ' ' Text '//Carriage Return' Comment.Single '\n ' Text 'Space' Name ' ' Text '=' Operator ' ' Text '#32' Literal.String.Char ';' Operator '\n ' Text 'EOLChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation 'CR' Name ',' Operator ' ' Text 'LF' Name ']' Punctuation ';' Operator '\n' Text '{$IFNDEF VER140}' Comment.Multiline '\n ' Text 'sLineBreak' Name ' ' Text '=' Operator ' ' Text '#13' Literal.String.Char '#10' Literal.String.Char ';' Operator '\n ' Text 'SwitchChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation "'" Literal.String '/' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String '-' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n' Text '{$ENDIF}' Comment.Multiline '\n ' Text 'EOL' Name ' ' Text '=' Operator ' ' Text 'sLineBreak' Name ';' Operator '\n ' Text 'MaxCard' Name ' ' Text '=' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Cardinal' Keyword.Type ')' Punctuation ';' Operator '\n ' Text 'AllChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation '#0' Literal.String.Char '.' Operator '.' Operator '#255' Literal.String.Char ']' Punctuation ';' Operator '\n ' Text 'Alphabetical' Name ' ' Text '=' Operator ' ' Text '[' Punctuation "'" Literal.String 'A' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String 'Z' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String 'a' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String 'z' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n ' Text 'DecimalChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String '9' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n ' Text 'AlphaNumerical' Name ' ' Text '=' Operator ' ' Text 'Alphabetical' Name ' ' Text '+' Operator ' ' Text 'DecimalChars' Name ';' Operator '\n ' Text 'StrangeChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation '#0' Literal.String.Char '.' Operator '.' Operator '#31' Literal.String.Char ',' Operator ' ' Text '#127' Literal.String.Char ',' Operator ' ' Text '#129' Literal.String.Char ',' Operator ' ' Text '#141' Literal.String.Char '.' Operator '.' Operator '#144' Literal.String.Char ',' Operator ' ' Text '#157' Literal.String.Char ',' Operator ' ' Text '#158' Literal.String.Char ']' Punctuation ';' Operator '\n\n ' Text 'HexadecimalChars' Name ' ' Text '=' Operator ' ' Text 'DecimalChars' Name ' ' Text '+' Operator ' ' Text '[' Punctuation "'" Literal.String 'A' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String 'F' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String 'a' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String 'f' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n ' Text 'OctalChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String '7' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n ' Text 'BinaryChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String '1' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n\n ' Text 'QuoteChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation "'" Literal.String "''" Literal.String.Escape "'" Literal.String ',' Operator ' ' Text "'" Literal.String '"' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n ' Text 'WildCards' Name ' ' Text '=' Operator ' ' Text '[' Punctuation "'" Literal.String '*' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String '?' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n ' Text 'FileNameEnemies' Name ' ' Text '=' Operator ' ' Text 'WildCards' Name ' ' Text '+' Operator ' ' Text '[' Punctuation "'" Literal.String '\\' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String '/' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String ':' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String '<' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String '>' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String '|' Literal.String "'" Literal.String ']' Punctuation ';' Operator '\n\n ' Text 'HexChar' Name ':' Operator ' ' Text 'array' Keyword '[' Punctuation 'THex' Name ']' Punctuation ' ' Text 'of' Keyword ' ' Text 'Char' Keyword.Type ' ' Text '=' Operator ' ' Text '(' Punctuation '\n ' Text "'" Literal.String '0' Literal.String "'" Literal.String ',' Operator "'" Literal.String '1' Literal.String "'" Literal.String ',' Operator "'" Literal.String '2' Literal.String "'" Literal.String ',' Operator "'" Literal.String '3' Literal.String "'" Literal.String ',' Operator "'" Literal.String '4' Literal.String "'" Literal.String ',' Operator "'" Literal.String '5' Literal.String "'" Literal.String ',' Operator "'" Literal.String '6' Literal.String "'" Literal.String ',' Operator "'" Literal.String '7' Literal.String "'" Literal.String ',' Operator "'" Literal.String '8' Literal.String "'" Literal.String ',' Operator "'" Literal.String '9' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'A' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'B' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'C' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'D' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'E' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'F' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n ' Text 'LowerHexChar' Name ':' Operator ' ' Text 'array' Keyword '[' Punctuation 'THex' Name ']' Punctuation ' ' Text 'of' Keyword ' ' Text 'Char' Keyword.Type ' ' Text '=' Operator ' ' Text '(' Punctuation '\n ' Text "'" Literal.String '0' Literal.String "'" Literal.String ',' Operator "'" Literal.String '1' Literal.String "'" Literal.String ',' Operator "'" Literal.String '2' Literal.String "'" Literal.String ',' Operator "'" Literal.String '3' Literal.String "'" Literal.String ',' Operator "'" Literal.String '4' Literal.String "'" Literal.String ',' Operator "'" Literal.String '5' Literal.String "'" Literal.String ',' Operator "'" Literal.String '6' Literal.String "'" Literal.String ',' Operator "'" Literal.String '7' Literal.String "'" Literal.String ',' Operator "'" Literal.String '8' Literal.String "'" Literal.String ',' Operator "'" Literal.String '9' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'a' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'b' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'c' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'd' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'e' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'f' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n ' Text 'BaseNChar' Name ':' Operator ' ' Text 'array' Keyword '[' Punctuation 'TBaseN' Name ']' Punctuation ' ' Text 'of' Keyword ' ' Text 'Char' Keyword.Type ' ' Text '=' Operator ' ' Text '(' Punctuation '\n ' Text "'" Literal.String '0' Literal.String "'" Literal.String ',' Operator "'" Literal.String '1' Literal.String "'" Literal.String ',' Operator "'" Literal.String '2' Literal.String "'" Literal.String ',' Operator "'" Literal.String '3' Literal.String "'" Literal.String ',' Operator "'" Literal.String '4' Literal.String "'" Literal.String ',' Operator "'" Literal.String '5' Literal.String "'" Literal.String ',' Operator "'" Literal.String '6' Literal.String "'" Literal.String ',' Operator "'" Literal.String '7' Literal.String "'" Literal.String ',' Operator "'" Literal.String '8' Literal.String "'" Literal.String ',' Operator "'" Literal.String '9' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'A' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'B' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'C' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'D' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'E' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'F' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'G' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'H' Literal.String "'" Literal.String ',' Operator '\n ' Text "'" Literal.String 'I' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'J' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'K' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'L' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'M' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'N' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'O' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'P' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'Q' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'R' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'S' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'T' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'U' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'V' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'W' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'X' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'Y' Literal.String "'" Literal.String ',' Operator "'" Literal.String 'Z' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n\n ' Text 'cYcnusOverlayColor' Name ' ' Text '=' Operator ' ' Text '$050001' Literal.Number.Hex ';' Operator '\n\n ' Text 'faFindEveryFile' Name ' ' Text '=' Operator ' ' Text 'faReadOnly' Name ' ' Text '+' Operator ' ' Text 'faHidden' Name ' ' Text '+' Operator ' ' Text 'faSysFile' Name ' ' Text '+' Operator ' ' Text 'faArchive' Name ';' Operator '\n\n ' Text 'platWin9x' Name ' ' Text '=' Operator ' ' Text '[' Punctuation 'VER_PLATFORM_WIN32s' Name ',' Operator ' ' Text 'VER_PLATFORM_WIN32_WINDOWS' Name ']' Punctuation ';' Operator '\n\n\n' Text '{ Debugging }' Comment.Multiline '\n' Text 'procedure' Keyword ' ' Text 'ClearReport' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'ReportName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'Report' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'ReportName' Name ',' Operator ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'ReportFmt' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'ReportName' Name ',' Operator ' ' Text 'Fmt' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'const' Keyword ' ' Text 'Args' Name ':' Operator ' ' Text 'array' Keyword ' ' Text 'of' Keyword ' ' Text 'const' Keyword ')' Punctuation ';' Operator '\n\n' Text '{ Params }' Comment.Multiline '\n' Text 'procedure' Keyword ' ' Text 'GetParams' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ')' Punctuation ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'GetParams' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ParamNum' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'ParamPrefixNum' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'Param' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'ParamPrefix' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Switch' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Switch' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'const' Keyword ' ' Text 'PrefixChars' Name ':' Operator ' ' Text 'TCharSet' Name ' ' Text '=' Operator ' ' Text 'SwitchChars' Name ';' Operator '\n ' Text 'IgnoreCase' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'GetParam' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator ' ' Text 'const' Keyword ' ' Text 'Default' Keyword.Pseudo ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Dirs & UserName}' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'GetMyDir' Name.Function '(' Punctuation 'FullPath' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'WinDir' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'SysDir' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'UserName' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Strings & Chars}' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'FirstChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'LastChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharPos' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'CharPos' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'TCharSet' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'CharPosR' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'PosEx' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'SubStr' Name ',' Operator ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'PosExText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'SubStr' Name ',' Operator ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'PosExAnsiText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'SubStr' Name ',' Operator ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UntilChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'UntilChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'UntilLastChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n ' Text 'IgnoreNoBrake' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FromChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'FromChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'FromLastChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n ' Text 'IgnoreNoBrake' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BetweenChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Start' Name ',' Operator ' ' Text 'Finish' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n ' Text 'Inclusive' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UntilStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'FromStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StringWrap' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Width' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'LineEnd' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text 'EOL' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Splitting & Combining }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'Split' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'IgnoreMultiSep' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'MinCount' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'Split' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator '\n ' Text 'IgnoreMultiSep' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'Split' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Separators' Name ':' Operator ' ' Text 'TCharSet' Name ';' Operator '\n ' Text 'IgnoreMultiSep' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator ' ' Text 'MinCount' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'TileStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'BrakeStart' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'BrakeEnd' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'out' Name ' ' Text 'Left' Name ',' Operator ' ' Text 'Right' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Join' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'Join' Name.Function '(' Punctuation 'StrA' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'MulStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Count' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Strings ausrichten }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'AlignR' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Width' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'Filler' Name ':' Operator ' ' Text 'Char' Keyword.Type ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'MaxStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'MaxLen' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Stringing }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'TrimAll' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ControlChar' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'FriendlyChar' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FriendlyStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'FriendlyStr' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Quote' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Quoter' Name ':' Operator ' ' Text 'Char' Keyword.Type ' ' Text '=' Operator ' ' Text "'" Literal.String '"' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'UnQuote' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'DeQuote' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrNumerus' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Value' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'Singular' Name ',' Operator ' ' Text 'Plural' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Zero' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String '0' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'MakeStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Items' Name ':' Operator ' ' Text 'array' Keyword ' ' Text 'of' Keyword ' ' Text 'const' Keyword ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'ShowText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Items' Name ':' Operator ' ' Text 'array' Keyword ' ' Text 'of' Keyword ' ' Text 'const' Keyword ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n\n' Text '{ Delete }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'DeleteChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'DeleteChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'ExtractChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Find }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'CharCount' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'CharIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrAtPos' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Pos' Name.Builtin ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'Str' Name.Builtin ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'StrAtBegin' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Str' Name.Builtin ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'StrIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'SubStr' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'StrIn' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'StrIn' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'StrIndex' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'StrIndex' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextAtPos' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Pos' Name.Builtin ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'TextAtBegin' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'TextIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'TextIn' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'TextIn' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'TextIndex' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'TextIndex' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text '{ Replace }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'ReplaceChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Old' Name ',' Operator ' ' Text 'New' Keyword ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'ReplaceChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Old' Name ':' Operator ' ' Text 'TCharSet' Name ';' Operator ' ' Text 'New' Keyword ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Replace' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Old' Name ',' Operator ' ' Text 'New' Keyword ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ TStrings }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'SLOfFile' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TStringList' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'ContainsEmptyLines' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'DeleteEmptyLines' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ')' Punctuation ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'DeleteCommentLines' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'CommentSign' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String '//' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'WriteSL' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Suffix' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FindLine' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'QuickSortSL' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStringList' Name ')' Punctuation ';' Operator '\n\n' Text '{ TStrA }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'IncStrA' Name.Function '(' Punctuation 'StrA' Name ':' Operator ' ' Text 'TStrA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n' Text '{ TByteA }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'StrOfByteA' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'ByteAOfStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'ByteAOfInt' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'IntOfByteA' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'ByteAOfHex' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Hex' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'SameByteA' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ',' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'Reverse' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'SaveByteA' Name.Function '(' Punctuation 'Data' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Overwrite' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'LoadByteA' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Endian' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n' Text '{ Files }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'SizeOfFile' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'FileEx' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'AllowFolders' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'LWPSolve' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Dir' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'LWPSlash' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Dir' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExtractDrive' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'ExtractPath' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'ExtractPrefix' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'ExtractSuffix' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IsValidFileName' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'MakeValidFileName' Name.Function '(' Punctuation 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'const' Keyword ' ' Text 'Default' Keyword.Pseudo ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String 'File' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Converting }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'IsValidInteger' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'IsValidCardinal' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrOfBool' Name.Function '(' Punctuation 'flag' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'TrueStr' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String 'True' Literal.String "'" Literal.String ';' Operator '\n ' Text 'const' Keyword ' ' Text 'FalseStr' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String 'False' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'StrOfInt' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'CardOfStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'HexOrd' Name.Function '(' Punctuation 'Hex' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'THex' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'ByteOfHex' Name.Function '(' Punctuation 'Hex' Name ':' Operator ' ' Text 'THexByteStr' Name ')' Punctuation ':' Operator ' ' Text 'Byte' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'DecOfHex' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Hex' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'HexOfByte' Name.Function '(' Punctuation 'b' Name ':' Operator ' ' Text 'Byte' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'THexByteStr' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'HexOfCard' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'HexOfCard' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator ' ' Text 'Digits' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'PascalHexArray' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'Name' Keyword.Pseudo ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'HexOfByteA' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'Blocks' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Splitter' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'BinOfByteA' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'Blocks' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '4' Literal.Number.Integer ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Splitter' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CardOfHex' Name.Function '(' Punctuation 'Hex' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'IntOfBin' Name.Function '(' Punctuation 'Bin' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BinOfIntFill' Name.Function '(' Punctuation 'n' Name ':' Operator ' ' Text 'cardinal' Keyword.Type ';' Operator ' ' Text 'MinCount' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '8' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'BinOfInt' Name.Function '(' Punctuation 'n' Name ':' Operator ' ' Text 'cardinal' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BaseNOfInt' Name.Function '(' Punctuation 'I' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'TBaseN' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'IntOfBaseN' Name.Function '(' Punctuation 'V' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'TBaseN' Name ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n\n' Text '{ Ranges }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'KeepIn' Name.Function '(' Punctuation 'i' Name ',' Operator ' ' Text 'Bottom' Name ',' Operator ' ' Text 'Top' Name ':' Operator ' ' Text 'Variant' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Variant' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'InRange' Name.Function '(' Punctuation 'Value' Name ',' Operator ' ' Text 'Bottom' Name ',' Operator ' ' Text 'Top' Name ':' Operator ' ' Text 'Variant' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'InStrictRange' Name.Function '(' Punctuation 'Value' Name ',' Operator ' ' Text 'Bottom' Name ',' Operator ' ' Text 'Top' Name ':' Operator ' ' Text 'Variant' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'Min' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ',' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'Min' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ':' Operator ' ' Text 'TIntA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'Max' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ',' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'Max' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ':' Operator ' ' Text 'TIntA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'overload' Name ';' Operator '\n\n' Text 'const' Keyword '\n ' Text 'RangesSeparator' Name ' ' Text '=' Operator ' ' Text "'" Literal.String ',' Literal.String "'" Literal.String ';' Operator '\n ' Text 'RangeInnerSeparator' Name ' ' Text '=' Operator ' ' Text "'" Literal.String '-' Literal.String "'" Literal.String ';' Operator '\n ' Text 'RangeInfinite' Name ' ' Text '=' Operator ' ' Text "'" Literal.String '*' Literal.String "'" Literal.String ';' Operator '\n ' Text 'RangeSpecialChars' Name ' ' Text '=' Operator ' ' Text '[' Punctuation 'RangesSeparator' Name ',' Operator ' ' Text 'RangeInnerSeparator' Name ',' Operator ' ' Text 'RangeInfinite' Name ']' Punctuation ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'RangesOfStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TRanges' Name ';' Operator '\n' Text 'function' Keyword ' ' Text 'InRanges' Name.Function '(' Punctuation 'Ranges' Name ':' Operator ' ' Text 'TRanges' Name ';' Operator ' ' Text 'TestValue' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Success' Name.Function '(' Punctuation 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'ResultOnSuccess' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'ERROR_SUCCESS' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'Failure' Name.Function '(' Punctuation 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'ResultOnSuccess' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'ERROR_SUCCESS' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExpandString' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Files }' Comment.Multiline '\n' Text 'procedure' Keyword ' ' Text 'DeleteFiles' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Mask' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'ScanSubDirs' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'Attributes' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'faFindEveryFile' Name ')' Punctuation ';' Operator '\n' Text 'procedure' Keyword ' ' Text 'FileNew' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n' Text 'function' Keyword ' ' Text 'DateTimeOfFileTime' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileTime' Name ':' Operator ' ' Text 'TFileTime' Name ')' Punctuation ':' Operator ' ' Text 'TDateTime' Keyword.Type ';' Operator '\n\n' Text '{ FileNames }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'GetFileNew' Name.Function '(' Punctuation 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'NoFloppyDrives' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text '{ Finding Files }' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'FindAll' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Mask' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'ScanSubDirs' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator ' ' Text 'Attributes' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'faFindEveryFile' Name ';' Operator '\n ' Text 'FileReturn' Name ':' Operator ' ' Text 'TFileNameFunc' Name ' ' Text '=' Operator ' ' Text 'nil' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'FindAllFirst' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Mask' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'ScanSubDirs' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'Attributes' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'faFindEveryFile' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FullOSInfo' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'Win32PlatformStr' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'function' Keyword ' ' Text 'Win9x' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'WinNT' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'Win2000' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'function' Keyword ' ' Text 'WinXP' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n\n' Text 'var' Keyword '\n ' Text 'MyDir' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'LastSuccessRes' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n \n' Text '{ Backward compatibility }' Comment.Multiline '\n' Text '{$IFNDEF VER130}' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'SameText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S1' Name ',' Operator ' ' Text 'S2' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text '{$ENDIF}' Comment.Multiline '\n\n' Text 'implementation' Keyword '\n' Text '{$IFNDEF VER140}' Comment.Multiline '\n' Text 'uses' Keyword ' ' Text 'FileCtrl' Name ';' Operator '\n' Text '{$ENDIF}' Comment.Multiline '\n\n' Text '{$IFNDEF VER130}' Comment.Multiline '\n' Text 'function' Keyword ' ' Text 'SameText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S1' Name ',' Operator ' ' Text 'S2' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'CompareText' Name.Builtin '(' Punctuation 'S1' Name ',' Operator ' ' Text 'S2' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n' Text '{$ENDIF}' Comment.Multiline '\n\n' Text 'procedure' Keyword ' ' Text 'Report' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'ReportName' Name ',' Operator ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'F' Name ':' Operator ' ' Text 'TextFile' Keyword.Type ';' Operator '\n ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'FileName' Name ' ' Text ':' Operator '=' Operator ' ' Text 'MyDir' Name ' ' Text '+' Operator ' ' Text 'ReportName' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '.rep' Literal.String "'" Literal.String ';' Operator '\n ' Text 'Assign' Name '(' Punctuation 'F' Name ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'try' Keyword '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'FileExists' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Rewrite' Name.Builtin '(' Punctuation 'F' Name ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Append' Name.Builtin '(' Punctuation 'F' Name ')' Punctuation ';' Operator '\n ' Text 'WriteLn' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text 'Text' Name ')' Punctuation ';' Operator '\n ' Text 'finally' Keyword '\n ' Text 'Close' Name.Builtin '(' Punctuation 'F' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'ClearReport' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'ReportName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'FileName' Name ' ' Text ':' Operator '=' Operator ' ' Text 'MyDir' Name ' ' Text '+' Operator ' ' Text 'ReportName' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '.rep' Literal.String "'" Literal.String ';' Operator '\n ' Text 'DeleteFile' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'ReportFmt' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'ReportName' Name ',' Operator ' ' Text 'Fmt' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'const' Keyword ' ' Text 'Args' Name ':' Operator ' ' Text 'array' Keyword ' ' Text 'of' Keyword ' ' Text 'const' Keyword ')' Punctuation ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Report' Name '(' Punctuation 'ReportName' Name ',' Operator ' ' Text 'Format' Name.Builtin '(' Punctuation 'Fmt' Name ',' Operator ' ' Text 'Args' Name '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'GetParams' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'P' Name ':' Operator ' ' Text 'PChar' Keyword.Type ';' Operator '\n ' Text 'Param' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n ' Text 'function' Keyword ' ' Text 'GetParamStr' Name.Function '(' Punctuation 'var' Keyword ' ' Text 'P' Name ':' Operator ' ' Text 'PChar' Keyword.Type ';' Operator ' ' Text 'var' Keyword ' ' Text 'Param' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n ' Text 'var' Keyword '\n ' Text 'Quoted' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'Param' Name ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n\n ' Text 'repeat' Keyword '\n ' Text 'while' Keyword ' ' Text '(' Punctuation 'P' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '<' Operator '>' Operator ' ' Text '#0' Literal.String.Char ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'P' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '<' Operator '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'P' Name ')' Punctuation ';' Operator '\n\n ' Text 'Quoted' Name ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'while' Keyword ' ' Text 'P' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '<' Operator '>' Operator ' ' Text '#0' Literal.String.Char ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'P' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String '"' Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Quoted' Name ' ' Text ':' Operator '=' Operator ' ' Text 'not' Keyword ' ' Text 'Quoted' Name ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'P' Name ')' Punctuation ';' Operator '\n ' Text 'Continue' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'P' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '<' Operator '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text 'not' Keyword ' ' Text 'Quoted' Name ' ' Text 'then' Keyword '\n ' Text 'Break' Keyword ';' Operator '\n ' Text 'Param' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Param' Name ' ' Text '+' Operator ' ' Text 'P' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'P' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'until' Keyword ' ' Text '(' Punctuation 'Param' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'or' Keyword ' ' Text '(' Punctuation 'P' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text '#0' Literal.String.Char ')' Punctuation ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Param' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'Strings' Name '.' Operator 'Clear' Name ';' Operator '\n ' Text 'P' Name ' ' Text ':' Operator '=' Operator ' ' Text 'GetCommandLine' Name ';' Operator '\n ' Text 'GetParamStr' Name '(' Punctuation 'P' Name ',' Operator ' ' Text 'Param' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'GetParamStr' Name '(' Punctuation 'P' Name ',' Operator ' ' Text 'Param' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Strings' Name '.' Operator 'Add' Name '(' Punctuation 'Param' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'GetParams' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'SL' Name ':' Operator ' ' Text 'TStringList' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'SL' Name ' ' Text ':' Operator '=' Operator ' ' Text 'TStringList' Name '.' Operator 'Create' Name ';' Operator '\n ' Text 'GetParams' Name '(' Punctuation 'SL' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Join' Name '(' Punctuation 'SL' Name ',' Operator ' ' Text 'Separator' Name ')' Punctuation ';' Operator '\n ' Text 'SL' Name '.' Operator 'Free' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Switch' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Switch' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'const' Keyword ' ' Text 'PrefixChars' Name ':' Operator ' ' Text 'TCharSet' Name ' ' Text '=' Operator ' ' Text 'SwitchChars' Name ';' Operator '\n ' Text 'IgnoreCase' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text '//= SysUtils.FindCmdLineSwitch' Comment.Single '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 's' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'True' Keyword ';' Operator '\n\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'ParamCount' Name.Builtin ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 's' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ParamStr' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text '(' Punctuation 's' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 's' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text 'in' Keyword ' ' Text 'PrefixChars' Name ')' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text "//i know that always s <> '', but this is saver" Comment.Single '\n ' Text 's' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 's' Name ',' Operator ' ' Text '2' Literal.Number.Integer ',' Operator ' ' Text 'MaxInt' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 's' Name ' ' Text '=' Operator ' ' Text 'Switch' Name ')' Punctuation ' ' Text 'or' Keyword ' ' Text '(' Punctuation 'IgnoreCase' Name ' ' Text 'and' Keyword ' ' Text '(' Punctuation '0' Literal.Number.Integer '=' Operator 'AnsiCompareText' Name.Builtin '(' Punctuation 's' Name ',' Operator ' ' Text 'Switch' Name ')))' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ParamNum' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'ParamCount' Name.Builtin ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text '0' Literal.Number.Integer '=' Operator 'AnsiCompareText' Name.Builtin '(' Punctuation 'ParamStr' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ',' Operator ' ' Text 'S' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ParamPrefixNum' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Len' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Prefix' Name ')' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'ParamCount' Name.Builtin ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text '0' Literal.Number.Integer '=' Operator 'AnsiCompareText' Name.Builtin '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'ParamStr' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Len' Name ')' Punctuation ',' Operator ' ' Text 'Prefix' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Param' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'ParamNum' Name '(' Punctuation 'S' Name ')' Punctuation ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ParamPrefix' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'ParamPrefixNum' Name '(' Punctuation 'Prefix' Name ')' Punctuation ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'GetParam' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator ' ' Text 'const' Keyword ' ' Text 'Default' Keyword.Pseudo ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Default' Keyword.Pseudo ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Prefix' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'ParamStr' Name.Builtin '(' Punctuation '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ParamPrefixNum' Name '(' Punctuation 'Prefix' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'ParamStr' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Prefix' Name ')' Punctuation ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'MaxInt' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'GetMyDir' Name.Function '(' Punctuation 'FullPath' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Buffer' Name ':' Operator ' ' Text 'array' Keyword '[' Punctuation '0' Literal.Number.Integer '.' Operator '.' Operator '260' Literal.Number.Integer ']' Punctuation ' ' Text 'of' Keyword ' ' Text 'Char' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'SetString' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Buffer' Name ',' Operator ' ' Text 'GetModuleFileName' Name.Builtin '(' Punctuation '0' Literal.Number.Integer ',' Operator ' ' Text 'Buffer' Name ',' Operator ' ' Text 'SizeOf' Name.Builtin '(' Punctuation 'Buffer' Name ')))' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'FullPath' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'GetFileNew' Name '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractPath' Name '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'WinDir' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Res' Name ':' Operator ' ' Text 'PChar' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ';' Operator '\n ' Text 'GetMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n ' Text 'GetWindowsDirectory' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Res' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ';' Operator '\n ' Text 'FreeMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'SysDir' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Res' Name ':' Operator ' ' Text 'PChar' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ';' Operator '\n ' Text 'GetMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n ' Text 'GetSystemDirectory' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Res' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ';' Operator '\n ' Text 'FreeMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UserName' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Len' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n ' Text 'Res' Name ':' Operator ' ' Text 'PChar' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'GetMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n ' Text 'Len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'MAX_PATH' Name ';' Operator '\n ' Text 'GetUserName' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text 'Len' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Res' Name ';' Operator '\n ' Text 'FreeMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'MAX_PATH' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FirstChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 's' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '#0' Literal.String.Char '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 's' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'LastChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 's' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '#0' Literal.String.Char '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 's' Name '[' Punctuation 'Length' Name.Builtin '(' Punctuation 's' Name ')]' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharPos' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'MaxPosToSearch' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Offset' Name ';' Operator '\n ' Text 'MaxPosToSearch' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'while' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator '=' Operator ' ' Text 'MaxPosToSearch' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ' ' Text '=' Operator ' ' Text 'C' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharPos' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'TCharSet' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'MaxPosToSearch' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Offset' Name ';' Operator '\n ' Text 'MaxPosToSearch' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'while' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator '=' Operator ' ' Text 'MaxPosToSearch' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ' ' Text 'in' Keyword ' ' Text 'C' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharPosR' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Offset' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ' ' Text '-' Operator ' ' Text 'Offset' Name '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Offset' Name ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '>' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'while' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ' ' Text '=' Operator ' ' Text 'C' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Dec' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'PosEx' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'SubStr' Name ',' Operator ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'MaxPosToSearch' Name ',' Operator ' ' Text 'LenSubStr' Name ',' Operator ' ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'SubStr' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Offset' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Offset' Name ';' Operator '\n\n ' Text 'LenSubStr' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'SubStr' Name ')' Punctuation ';' Operator '\n ' Text 'MaxPosToSearch' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'LenSubStr' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n\n ' Text 'while' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator '=' Operator ' ' Text 'MaxPosToSearch' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ' ' Text '=' Operator ' ' Text 'SubStr' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n\n ' Text 'while' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '<' Operator ' ' Text 'LenSubStr' Name ')' Punctuation '\n ' Text 'and' Keyword ' ' Text '(' Punctuation 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text 'SubStr' Name '[' Punctuation 'i' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer '])' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'LenSubStr' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'PosExText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'SubStr' Name ',' Operator ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'MaxPosToSearch' Name ',' Operator ' ' Text 'LenSubStr' Name ',' Operator ' ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'function' Keyword ' ' Text 'SameChar' Name.Function '(' Punctuation 'a' Name ',' Operator ' ' Text 'b' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'UpCase' Name.Builtin '(' Punctuation 'a' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'UpCase' Name.Builtin '(' Punctuation 'b' Name ')' Punctuation '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'SubStr' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Offset' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Offset' Name ';' Operator '\n\n ' Text 'LenSubStr' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'SubStr' Name ')' Punctuation ';' Operator '\n ' Text 'MaxPosToSearch' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'LenSubStr' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n\n ' Text 'while' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator '=' Operator ' ' Text 'MaxPosToSearch' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'SameChar' Name '(' Punctuation 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ',' Operator ' ' Text 'SubStr' Name '[' Punctuation '1' Literal.Number.Integer '])' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n\n ' Text 'while' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '<' Operator ' ' Text 'LenSubStr' Name ')' Punctuation '\n ' Text 'and' Keyword ' ' Text '(' Punctuation 'SameChar' Name '(' Punctuation 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'i' Name ']' Punctuation ',' Operator ' ' Text 'SubStr' Name '[' Punctuation 'i' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ']))' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'LenSubStr' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'PosExAnsiText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'SubStr' Name ',' Operator ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Offset' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'MaxPosToSearch' Name ',' Operator ' ' Text 'LenSubStr' Name ',' Operator ' ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'function' Keyword ' ' Text 'SameChar' Name.Function '(' Punctuation 'a' Name ',' Operator ' ' Text 'b' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'CharLower' Name '(' Punctuation 'PChar' Keyword.Type '(' Punctuation 'a' Name '))' Punctuation ' ' Text '=' Operator ' ' Text 'CharLower' Name '(' Punctuation 'PChar' Keyword.Type '(' Punctuation 'b' Name '))' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'SubStr' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Offset' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Offset' Name ';' Operator '\n\n ' Text 'LenSubStr' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'SubStr' Name ')' Punctuation ';' Operator '\n ' Text 'MaxPosToSearch' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'LenSubStr' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n\n ' Text 'while' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator '=' Operator ' ' Text 'MaxPosToSearch' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'SameChar' Name '(' Punctuation 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ',' Operator ' ' Text 'SubStr' Name '[' Punctuation '1' Literal.Number.Integer '])' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n\n ' Text 'while' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '<' Operator ' ' Text 'LenSubStr' Name ')' Punctuation '\n ' Text 'and' Keyword ' ' Text '(' Punctuation 'SameChar' Name '(' Punctuation 'S' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'i' Name ']' Punctuation ',' Operator ' ' Text 'SubStr' Name '[' Punctuation 'i' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ']))' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '=' Operator ' ' Text 'LenSubStr' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UntilChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'p' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UntilChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'p' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UntilLastChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n ' Text 'IgnoreNoBrake' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPosR' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'p' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'IgnoreNoBrake' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FromChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'p' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FromChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'p' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FromLastChar' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n ' Text 'IgnoreNoBrake' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPosR' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'p' Name ')' Punctuation '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'IgnoreNoBrake' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BetweenChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Start' Name ',' Operator ' ' Text 'Finish' Name ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n ' Text 'Inclusive' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Start' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'fin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Finish' Name ',' Operator ' ' Text 'S' Name ',' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'fin' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'Inclusive' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'p' Name ')' Punctuation ';' Operator '\n ' Text 'Dec' Name.Builtin '(' Punctuation 'fin' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ' ' Text '-' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UntilStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Brake' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'UntilChar' Name '(' Punctuation 'S' Name ',' Operator ' ' Text 'Brake' Name '[' Punctuation '1' Literal.Number.Integer '])' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'p' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FromStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Brake' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Brake' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'FromChar' Name '(' Punctuation 'S' Name ',' Operator ' ' Text 'Brake' Name '[' Punctuation '1' Literal.Number.Integer '])' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'Brake' Name ',' Operator ' ' Text 's' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'p' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'p' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Brake' Name '))' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StringWrap' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Width' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'LineEnd' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text 'EOL' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'S' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'or' Keyword ' ' Text '(' Punctuation 'Width' Name ' ' Text '<' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'while' Keyword ' ' Text 'True' Keyword ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'i' Name ',' Operator ' ' Text 'Width' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ',' Operator ' ' Text 'Width' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'LineEnd' Name '\n ' Text 'else' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Split' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'IgnoreMultiSep' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'MinCount' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'TStrA' Name ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ',' Operator ' ' Text 'SepLen' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'Add' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'IgnoreMultiSep' Name ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'S' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'High' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')]' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '<' Operator ' ' Text 'MinCount' Name ' ' Text 'then' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'MinCount' Name ')' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'nil' Keyword ';' Operator '\n ' Text 'SepLen' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Separator' Name ')' Punctuation ';' Operator '\n\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'fin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'Separator' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'fin' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Add' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ' ' Text '-' Operator ' ' Text 'p' Name '))' Punctuation ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'fin' Name ' ' Text '+' Operator ' ' Text 'SepLen' Name ';' Operator '\n ' Text 'fin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'Separator' Name ',' Operator ' ' Text 'S' Name ',' Operator ' ' Text 'p' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Add' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer '))' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '<' Operator ' ' Text 'MinCount' Name ' ' Text 'then' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'MinCount' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'Split' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator '\n ' Text 'IgnoreMultiSep' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ';' Operator ' \n' Text 'var' Keyword '\n ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ',' Operator ' ' Text 'SepLen' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'Add' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'IgnoreMultiSep' Name ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'S' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Strings' Name '.' Operator 'Add' Name '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Strings' Name '.' Operator 'BeginUpdate' Name ';' Operator '\n ' Text 'SepLen' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Separator' Name ')' Punctuation ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'fin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'Separator' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'fin' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Add' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ' ' Text '-' Operator ' ' Text 'p' Name '))' Punctuation ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'fin' Name ' ' Text '+' Operator ' ' Text 'SepLen' Name ';' Operator '\n ' Text 'fin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'Separator' Name ',' Operator ' ' Text 'S' Name ',' Operator ' ' Text 'p' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Add' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer '))' Punctuation ';' Operator '\n ' Text 'Strings' Name '.' Operator 'EndUpdate' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Split' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Separators' Name ':' Operator ' ' Text 'TCharSet' Name ';' Operator '\n ' Text 'IgnoreMultiSep' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator ' ' Text 'MinCount' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'TStrA' Name ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'Add' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'IgnoreMultiSep' Name ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'S' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'High' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')]' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '<' Operator ' ' Text 'MinCount' Name ' ' Text 'then' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'MinCount' Name ')' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'nil' Keyword ';' Operator '\n\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'fin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Separators' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'fin' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Add' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'fin' Name ' ' Text '-' Operator ' ' Text 'p' Name '))' Punctuation ';' Operator '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'fin' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'fin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'Separators' Name ',' Operator ' ' Text 'S' Name ',' Operator ' ' Text 'p' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Add' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'p' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer '))' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '<' Operator ' ' Text 'MinCount' Name ' ' Text 'then' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'MinCount' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'TileStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'BrakeStart' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'BrakeEnd' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'out' Name ' ' Text 'Left' Name ',' Operator ' ' Text 'Right' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Left' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'BrakeStart' Name '-' Operator '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'Right' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'BrakeEnd' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'MaxInt' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Join' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ',' Operator ' ' Text 'imax' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'imax' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Strings' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'imax' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Strings' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'imax' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Separator' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Join' Name.Function '(' Punctuation 'StrA' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'overload' Name ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'StrA' Name ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'StrA' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'StrA' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Separator' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'MulStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Count' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'P' Name ':' Operator ' ' Text 'PChar' Keyword.Type ';' Operator '\n ' Text 'Len' Name ',' Operator ' ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Count' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Len' Name ' ' Text '*' Operator ' ' Text 'Count' Name ')' Punctuation ';' Operator '\n\n ' Text 'P' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Pointer' Keyword.Type '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Count' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Move' Name.Builtin '(' Punctuation 'Pointer' Keyword.Type '(' Punctuation 'S' Name ')' Punctuation '^' Operator ',' Operator ' ' Text 'P' Name '^' Operator ',' Operator ' ' Text 'Len' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'P' Name ',' Operator ' ' Text 'Len' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'AlignR' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Width' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'Filler' Name ':' Operator ' ' Text 'Char' Keyword.Type ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'MulStr' Name '(' Punctuation 'Filler' Name ',' Operator ' ' Text 'Width' Name ' ' Text '-' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name '))' Punctuation ' ' Text '+' Operator ' ' Text 'S' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'MaxStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'MaxLen' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Len' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Len' Name ' ' Text '<' Operator '=' Operator ' ' Text 'MaxLen' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n ' Text 'Exit' Keyword ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'MaxLen' Name ' ' Text '-' Operator ' ' Text '3' Literal.Number.Integer ')' Punctuation ' ' Text '+' Operator ' ' Text "'" Literal.String '...' Literal.String "'" Literal.String ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TrimAll' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '>' Operator ' ' Text '#32' Literal.String.Char ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ControlChar' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'C' Name ' ' Text 'in' Keyword ' ' Text 'StrangeChars' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FriendlyChar' Name.Function '(' Punctuation 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Char' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'case' Keyword ' ' Text 'C' Name ' ' Text 'of' Keyword '\n ' Text '#0' Literal.String.Char ':' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '.' Literal.String "'" Literal.String ';' Operator '\n ' Text '#1' Literal.String.Char '.' Operator '.' Operator '#31' Literal.String.Char ':' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '?' Literal.String "'" Literal.String ';' Operator '\n ' Text '#255' Literal.String.Char ':' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '#' Literal.String "'" Literal.String ';' Operator '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'C' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FriendlyStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name '))' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'FriendlyChar' Name '(' Punctuation 'S' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FriendlyStr' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'a' Name '))' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'a' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'FriendlyChar' Name '(' Punctuation 'Char' Keyword.Type '(' Punctuation 'a' Name '[' Punctuation 'i' Name ']))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Quote' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Quoter' Name ':' Operator ' ' Text 'Char' Keyword.Type ' ' Text '=' Operator ' ' Text "'" Literal.String '"' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'FirstChar' Name '(' Punctuation 'S' Name ')' Punctuation ' ' Text '<' Operator '>' Operator ' ' Text 'Quoter' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Quoter' Name ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'LastChar' Name '(' Punctuation 'S' Name ')' Punctuation ' ' Text '<' Operator '>' Operator ' ' Text 'Quoter' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Quoter' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'DeQuote' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '>' Operator ' ' Text '2' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '2' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'UnQuote' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Start' Name ',' Operator ' ' Text 'Len' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Start' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'Len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'S' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'S' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text 'in' Keyword ' ' Text '([' Punctuation '#0' Literal.String.Char '.' Operator '.' Operator '#32' Literal.String.Char ']' Punctuation ' ' Text '+' Operator ' ' Text 'QuoteChars' Name '))' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'LastChar' Name '(' Punctuation 'S' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'S' Name '[' Punctuation '1' Literal.Number.Integer '])' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Dec' Name.Builtin '(' Punctuation 'Len' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Start' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'Start' Name ',' Operator ' ' Text 'Len' Name ' ' Text '-' Operator ' ' Text 'Start' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrNumerus' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Value' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'Singular' Name ',' Operator ' ' Text 'Plural' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Zero' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String '0' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Abs' Name.Builtin '(' Punctuation 'Value' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'IntToStr' Name.Builtin '(' Punctuation 'Value' Name ')' Punctuation ' ' Text '+' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'Singular' Name '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'Value' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Zero' Name ' ' Text '+' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'Plural' Name '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'IntToStr' Name.Builtin '(' Punctuation 'Value' Name ')' Punctuation ' ' Text '+' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'Plural' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'MakeStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Items' Name ':' Operator ' ' Text 'array' Keyword ' ' Text 'of' Keyword ' ' Text 'const' Keyword ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'const' Keyword '\n ' Text 'BoolStrings' Name ':' Operator ' ' Text 'array' Keyword '[' Punctuation 'Boolean' Keyword.Type ']' Punctuation ' ' Text 'of' Keyword ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text '(' Punctuation "'" Literal.String 'False' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String 'True' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'function' Keyword ' ' Text 'StrOfP' Name.Function '(' Punctuation 'P' Name ':' Operator ' ' Text 'Pointer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'P' Name ' ' Text '=' Operator ' ' Text 'nil' Keyword ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '[nil]' Literal.String "'" Literal.String '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '[' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'IntToStr' Name.Builtin '(' Punctuation 'Cardinal' Keyword.Type '(' Punctuation 'P' Name '))' Punctuation ' ' Text '+' Operator ' ' Text "'" Literal.String ']' Literal.String "'" Literal.String ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'Add' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 's' Name ' ' Text '+' Operator ' ' Text 'Separator' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'Items' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'with' Keyword ' ' Text 'Items' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'do' Keyword '\n ' Text 'case' Keyword ' ' Text 'VType' Name ' ' Text 'of' Keyword '\n ' Text 'vtString' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'VString' Name '^' Operator ')' Punctuation ';' Operator '\n ' Text 'vtInteger' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'IntToStr' Name.Builtin '(' Punctuation 'VInteger' Name '))' Punctuation ';' Operator '\n ' Text 'vtBoolean' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'BoolStrings' Name '[' Punctuation 'VBoolean' Name '])' Punctuation ';' Operator '\n ' Text 'vtChar' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'VChar' Name ')' Punctuation ';' Operator '\n ' Text 'vtPChar' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'VPChar' Name ')' Punctuation ';' Operator '\n ' Text 'vtExtended' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'FloatToStr' Name.Builtin '(' Punctuation 'VExtended' Name '^' Operator '))' Punctuation ';' Operator '\n ' Text 'vtObject' Name ':' Operator ' ' Text 'if' Keyword ' ' Text 'VObject' Name ' ' Text 'is' Keyword ' ' Text 'TComponent' Name ' ' Text 'then' Keyword '\n ' Text 'Add' Name '(' Punctuation 'TComponent' Name '(' Punctuation 'VObject' Name ')' Punctuation '.' Operator 'Name' Name ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Add' Name '(' Punctuation 'VObject' Name '.' Operator 'ClassName' Name ')' Punctuation ';' Operator '\n ' Text 'vtClass' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'VClass' Name '.' Operator 'ClassName' Name ')' Punctuation ';' Operator '\n ' Text 'vtAnsiString' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'string' Keyword '(' Punctuation 'VAnsiString' Name '))' Punctuation ';' Operator '\n ' Text 'vtCurrency' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'CurrToStr' Name.Builtin '(' Punctuation 'VCurrency' Name '^' Operator '))' Punctuation ';' Operator '\n ' Text 'vtInt64' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'IntToStr' Name.Builtin '(' Punctuation 'VInt64' Name '^' Operator '))' Punctuation ';' Operator '\n ' Text 'vtVariant' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'string' Keyword '(' Punctuation 'VVariant' Name '^' Operator '))' Punctuation ';' Operator '\n\n ' Text 'vtWideChar' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'VWideChar' Name ')' Punctuation ';' Operator '\n ' Text 'vtPWideChar' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'VPWideChar' Name ')' Punctuation ';' Operator '\n ' Text 'vtInterface' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'StrOfP' Name '(' Punctuation 'VInterface' Name '))' Punctuation ';' Operator '\n ' Text 'vtPointer' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'StrOfP' Name '(' Punctuation 'VPointer' Name '))' Punctuation ';' Operator '\n ' Text 'vtWideString' Name ':' Operator ' ' Text 'Add' Name '(' Punctuation 'WideString' Keyword.Type '(' Punctuation 'VWideString' Name '))' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '-' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Separator' Name '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'ShowText' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Items' Name ':' Operator ' ' Text 'array' Keyword ' ' Text 'of' Keyword ' ' Text 'const' Keyword ';' Operator ' ' Text 'Separator' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Text' Name ' ' Text ':' Operator '=' Operator ' ' Text 'MakeStr' Name '(' Punctuation 'Items' Name ',' Operator ' ' Text 'Separator' Name ')' Punctuation ';' Operator '\n\n ' Text 'MessageBox' Name '(' Punctuation '0' Literal.Number.Integer ',' Operator ' ' Text 'PChar' Keyword.Type '(' Punctuation 'Text' Name ')' Punctuation ',' Operator ' ' Text "'" Literal.String 'Info' Literal.String "'" Literal.String ',' Operator ' ' Text 'MB_OK' Name ' ' Text 'and' Keyword ' ' Text 'MB_APPLMODAL' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'DeleteChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '<' Operator '>' Operator ' ' Text 'C' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'DeleteChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text '(' Punctuation 'S' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'in' Keyword ' ' Text 'C' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExtractChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'in' Keyword ' ' Text 'C' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharCount' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text 'C' Name ' ' Text 'then' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrAtPos' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Pos' Name.Builtin ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'Str' Name.Builtin ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'Str' Name.Builtin ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'Str' Name.Builtin ' ' Text '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'Pos' Name.Builtin ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Str' Name.Builtin ')))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextAtPos' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Pos' Name.Builtin ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'Text' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text 'SameText' Name.Builtin '(' Punctuation 'Text' Name ',' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'Pos' Name.Builtin ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Text' Name ')))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrAtBegin' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Str' Name.Builtin ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'StrAtPos' Name '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Str' Name.Builtin ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextAtBegin' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'TextAtPos' Name '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Text' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text 'C' Name ' ' Text 'then' Keyword ' ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CharIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'C' Name ':' Operator ' ' Text 'TCharSet' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'in' Keyword ' ' Text 'C' Name ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'SubStr' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'SubStr' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrIn' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'SL' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'S' Name ' ' Text '=' Operator ' ' Text 'SL' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrIn' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Low' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'S' Name ' ' Text '=' Operator ' ' Text 'A' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextIn' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'PosExText' Name '(' Punctuation 'Text' Name ',' Operator ' ' Text 'S' Name ')' Punctuation ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextIn' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'SL' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'SameText' Name.Builtin '(' Punctuation 'Text' Name ',' Operator ' ' Text 'SL' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextIn' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Low' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'SameText' Name.Builtin '(' Punctuation 'Text' Name ',' Operator ' ' Text 'A' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrIndex' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'SL' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name ' ' Text '=' Operator ' ' Text 'SL' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrIndex' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Low' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name ' ' Text '=' Operator ' ' Text 'A' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextIndex' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'SL' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'SameText' Name.Builtin '(' Punctuation 'Text' Name ',' Operator ' ' Text 'SL' Name '[' Punctuation 'Result' Name.Builtin.Pseudo '])' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TextIndex' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TStrA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Text' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Low' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'SameText' Name.Builtin '(' Punctuation 'Text' Name ',' Operator ' ' Text 'A' Name '[' Punctuation 'Result' Name.Builtin.Pseudo '])' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ReplaceChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Old' Name ',' Operator ' ' Text 'New' Keyword ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text 'Old' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'New' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ReplaceChars' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'Old' Name ':' Operator ' ' Text 'TCharSet' Name ';' Operator ' ' Text 'New' Keyword ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'S' Name ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'in' Keyword ' ' Text 'Old' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'New' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Replace' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ',' Operator ' ' Text 'Old' Name ',' Operator ' ' Text 'New' Keyword ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'oldp' Name ',' Operator ' ' Text 'ps' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'ps' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'while' Keyword ' ' Text 'True' Keyword ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'oldp' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ps' Name ';' Operator '\n ' Text 'ps' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PosEx' Name '(' Punctuation 'Old' Name ',' Operator ' ' Text 'S' Name ',' Operator ' ' Text 'oldp' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'ps' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'oldp' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'S' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'oldp' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'oldp' Name ',' Operator ' ' Text 'ps' Name ' ' Text '-' Operator ' ' Text 'oldp' Name ')' Punctuation ' ' Text '+' Operator ' ' Text 'New' Keyword ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'ps' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Old' Name '))' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'SLOfFile' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TStringList' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'TStringList' Name '.' Operator 'Create' Name ';' Operator '\n ' Text 'if' Keyword ' ' Text 'FileExists' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo '.' Operator 'LoadFromFile' Name '(' Punctuation 'FileName' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ContainsEmptyLines' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'StrIn' Name '(' Punctuation 'SL' Name ',' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'DeleteEmptyLines' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'while' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'SL' Name '.' Operator 'Count' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'SL' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'SL' Name '.' Operator 'Delete' Name '(' Punctuation 'i' Name ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'DeleteCommentLines' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'CommentSign' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String '//' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'while' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'SL' Name '.' Operator 'Count' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'SL' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'or' Keyword ' ' Text '(' Punctuation 'StrAtBegin' Name '(' Punctuation 'TrimLeft' Name.Builtin '(' Punctuation 'SL' Name '[' Punctuation 'i' Name '])' Punctuation ',' Operator ' ' Text 'CommentSign' Name '))' Punctuation ' ' Text 'then' Keyword '\n ' Text 'SL' Name '.' Operator 'Delete' Name '(' Punctuation 'i' Name ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FindLine' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'SL' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'TextAtBegin' Name '(' Punctuation 'SL' Name '[' Punctuation 'Result' Name.Builtin.Pseudo ']' Punctuation ',' Operator ' ' Text 'S' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'QuickSortSL' Name.Function '(' Punctuation 'SL' Name ':' Operator ' ' Text 'TStringList' Name ')' Punctuation ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'Sort' Name.Function '(' Punctuation 'l' Name ',' Operator ' ' Text 'r' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ';' Operator '\n ' Text 'var' Keyword '\n ' Text 'i' Name ',' Operator 'j' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'z' Name ',' Operator 'x' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'l' Name ';' Operator '\n ' Text 'j' Name ' ' Text ':' Operator '=' Operator ' ' Text 'r' Name ';' Operator '\n ' Text 'x' Name ' ' Text ':' Operator '=' Operator ' ' Text 'SL' Name '[(' Punctuation 'j' Name ' ' Text '+' Operator ' ' Text 'i' Name ')' Punctuation ' ' Text 'div' Keyword ' ' Text '2' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'repeat' Keyword '\n ' Text 'while' Keyword ' ' Text 'SL' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '<' Operator ' ' Text 'x' Name ' ' Text 'do' Keyword ' ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'SL' Name '[' Punctuation 'j' Name ']' Punctuation ' ' Text '>' Operator ' ' Text 'x' Name ' ' Text 'do' Keyword ' ' Text 'Dec' Name.Builtin '(' Punctuation 'j' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator '=' Operator ' ' Text 'j' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'z' Name ' ' Text ':' Operator '=' Operator ' ' Text 'SL' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n ' Text 'SL' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'SL' Name '[' Punctuation 'j' Name ']' Punctuation ';' Operator '\n ' Text 'SL' Name '[' Punctuation 'j' Name ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'z' Name ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator ' ' Text 'Dec' Name.Builtin '(' Punctuation 'j' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'until' Keyword ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text 'j' Name ';' Operator '\n ' Text 'if' Keyword ' ' Text 'j' Name ' ' Text '>' Operator ' ' Text 'l' Name ' ' Text 'then' Keyword ' ' Text 'Sort' Name '(' Punctuation 'l' Name ',' Operator ' ' Text 'j' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'r' Name ' ' Text 'then' Keyword ' ' Text 'Sort' Name '(' Punctuation 'i' Name ',' Operator ' ' Text 'r' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'SL' Name '.' Operator 'Count' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Sort' Name '(' Punctuation '0' Literal.Number.Integer ',' Operator ' ' Text 'SL' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IncStrA' Name.Function '(' Punctuation 'StrA' Name ':' Operator ' ' Text 'TStrA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'StrA' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'StrA' Name ')' Punctuation ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'StrA' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrOfByteA' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'string' Keyword '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'a' Name ',' Operator ' ' Text '0' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'a' Name ')))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ByteAOfStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'TByteA' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 's' Name ')))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ByteAOfInt' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'SizeOf' Name.Builtin '(' Punctuation 'Integer' Keyword.Type '))' Punctuation ';' Operator '\n ' Text 'Move' Name.Builtin '(' Punctuation 'i' Name ',' Operator ' ' Text 'Pointer' Keyword.Type '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation '^' Operator ',' Operator ' ' Text 'SizeOf' Name.Builtin '(' Punctuation 'Integer' Keyword.Type '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IntOfByteA' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Move' Name.Builtin '(' Punctuation 'Pointer' Keyword.Type '(' Punctuation 'A' Name ')' Punctuation '^' Operator ',' Operator ' ' Text 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Min' Name.Builtin '(' Punctuation 'Length' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ',' Operator ' ' Text 'SizeOf' Name.Builtin '(' Punctuation 'Integer' Keyword.Type ')))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ByteAOfHex' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Hex' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'h' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'h' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractChars' Name '(' Punctuation 'Hex' Name ',' Operator ' ' Text 'HexadecimalChars' Name ')' Punctuation ';' Operator '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'h' Name ')' Punctuation ' ' Text 'div' Keyword ' ' Text '2' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'ByteOfHex' Name '(' Punctuation 'Copy' Name.Builtin '(' Punctuation 'h' Name ',' Operator ' ' Text '(' Punctuation 'i' Name ' ' Text 'shl' Keyword ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text '2' Literal.Number.Integer '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'SizeOfFile' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'F' Name ':' Operator ' ' Text 'file' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'AssignFile' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text '{$I-}' Comment.Multiline 'Reset' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '{$I+}' Comment.Multiline '\n ' Text 'if' Keyword ' ' Text 'IOResult' Name.Builtin ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'FileSize' Name.Builtin '(' Punctuation 'F' Name ')' Punctuation ';' Operator '\n ' Text 'CloseFile' Name.Builtin '(' Punctuation 'F' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FileEx' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'AllowFolders' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'False' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'FindData' Name ':' Operator ' ' Text 'TWin32FindData' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'FileName' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'AllowFolders' Name ' ' Text 'and' Keyword ' ' Text 'DirectoryExists' Name.Builtin '(' Punctuation 'FileName' Name '))' Punctuation ' ' Text 'or' Keyword '\n ' Text '(' Punctuation 'FindFirstFile' Name '(' Punctuation 'PChar' Keyword.Type '(' Punctuation 'FileName' Name ')' Punctuation ',' Operator ' ' Text 'FindData' Name ')' Punctuation ' ' Text '<' Operator '>' Operator ' ' Text 'INVALID_HANDLE_VALUE' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'and' Keyword ' ' Text 'not' Keyword ' ' Text 'CharIn' Name '(' Punctuation 'FileName' Name ',' Operator ' ' Text 'WildCards' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'AllowFolders' Name '\n ' Text 'or' Keyword ' ' Text '((' Punctuation 'FindData' Name '.' Operator 'dwFileAttributes' Name ' ' Text 'and' Keyword ' ' Text 'FILE_ATTRIBUTE_DIRECTORY' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'LWPSolve' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Dir' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'Dir' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'Dir' Name '[' Punctuation 'Length' Name.Builtin '(' Punctuation 'Dir' Name ')]' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'Dir' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Dir' Name ')' Punctuation ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Dir' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'LWPSlash' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Dir' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'Dir' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'Dir' Name '[' Punctuation 'Length' Name.Builtin '(' Punctuation 'Dir' Name ')]' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'Dir' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Dir' Name '))' Punctuation ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Dir' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExtractDrive' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'Length' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ' ' Text '>' Operator '=' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'FileName' Name '[' Punctuation '2' Literal.Number.Integer ']' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String ':' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'UpperCase' Name.Builtin '(' Punctuation 'FileName' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text '+' Operator ' ' Text "'" Literal.String ':\\' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExtractPath' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPosR' Name '(' Punctuation "'" Literal.String '\\' Literal.String "'" Literal.String ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'P' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'FileName' Name ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text 'p' Name ')' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'FileName' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExtractPrefix' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'UntilLastChar' Name '(' Punctuation 'ExtractFileName' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ',' Operator ' ' Text "'" Literal.String '.' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExtractSuffix' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'FromLastChar' Name '(' Punctuation 'ExtractFileName' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ',' Operator ' ' Text "'" Literal.String '.' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'SameByteA' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ',' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'A' Name ' ' Text '=' Operator ' ' Text 'B' Name ')' Punctuation ' ' Text 'or' Keyword ' ' Text '((' Punctuation 'Length' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'B' Name '))' Punctuation ' ' Text 'and' Keyword ' ' Text 'CompareMem' Name.Builtin '(' Punctuation 'A' Name ',' Operator ' ' Text 'B' Name ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'A' Name ')))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Reverse' Name.Function '(' Punctuation 'A' Name ':' Operator ' ' Text 'TByteA' Name ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'A' Name '))' Punctuation ';' Operator '\n\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'High' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '-' Operator ' ' Text 'i' Name ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'A' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Endian' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'type' Keyword '\n ' Text 'EndianArray' Name ' ' Text '=' Operator ' ' Text 'packed' Keyword ' ' Text 'array' Keyword '[' Punctuation '0' Literal.Number.Integer '.' Operator '.' Operator '3' Literal.Number.Integer ']' Punctuation ' ' Text 'of' Keyword ' ' Text 'Byte' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'a' Name ',' Operator ' ' Text 'b' Name ':' Operator ' ' Text 'EndianArray' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'a' Name ' ' Text ':' Operator '=' Operator ' ' Text 'EndianArray' Name '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n ' Text 'b' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'a' Name '[' Punctuation '3' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'b' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'a' Name '[' Punctuation '2' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'b' Name '[' Punctuation '2' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'a' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'b' Name '[' Punctuation '3' Literal.Number.Integer ']' Punctuation ' ' Text ':' Operator '=' Operator ' ' Text 'a' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Integer' Keyword.Type '(' Punctuation 'b' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'SaveByteA' Name.Function '(' Punctuation 'Data' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'Overwrite' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'F' Name ':' Operator ' ' Text 'file' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'FileExists' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ' ' Text 'and' Keyword ' ' Text 'not' Keyword ' ' Text 'Overwrite' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'Exit' Keyword ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'AssignFile' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text '{$I-}' Comment.Multiline 'Rewrite' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '{$I+}' Comment.Multiline '\n ' Text 'if' Keyword ' ' Text 'IOResult' Name.Builtin ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Data' Name ')' Punctuation ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'BlockWrite' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text 'Data' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ',' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Data' Name '))' Punctuation ';' Operator '\n ' Text 'CloseFile' Name.Builtin '(' Punctuation 'F' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'LoadByteA' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TByteA' Name ';' Operator '\n' Text 'var' Keyword '\n ' Text 'F' Name ':' Operator ' ' Text 'file' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'AssignFile' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text '{$I-}' Comment.Multiline 'Reset' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ';' Operator '{$I+}' Comment.Multiline '\n ' Text 'if' Keyword ' ' Text 'IOResult' Name.Builtin ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'FileSize' Name.Builtin '(' Punctuation 'F' Name '))' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ')' Punctuation ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'BlockRead' Name.Builtin '(' Punctuation 'F' Name ',' Operator ' ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ',' Operator ' ' Text 'FileSize' Name.Builtin '(' Punctuation 'F' Name '))' Punctuation ';' Operator '\n ' Text 'CloseFile' Name.Builtin '(' Punctuation 'F' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IsValidFileName' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'FileName' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text 'not' Keyword ' ' Text 'CharIn' Name '(' Punctuation 'FileName' Name ',' Operator ' ' Text 'FileNameEnemies' Name ')' Punctuation '\n ' Text 'and' Keyword ' ' Text 'CharIn' Name '(' Punctuation 'Trim' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ',' Operator ' ' Text 'AllChars' Name ' ' Text '-' Operator ' ' Text '[' Punctuation "'" Literal.String '.' Literal.String "'" Literal.String '])' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'MakeValidFileName' Name.Function '(' Punctuation 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'const' Keyword ' ' Text 'Default' Keyword.Pseudo ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String 'File' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'FileName' Name ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'FileName' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Default' Keyword.Pseudo ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'CharIn' Name '(' Punctuation 'FileName' Name ',' Operator ' ' Text 'FileNameEnemies' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'ReplaceChars' Name '(' Punctuation 'FileName' Name ',' Operator ' ' Text 'FileNameEnemies' Name ',' Operator ' ' Text "'" Literal.String '_' Literal.String "'" Literal.String ')' Punctuation '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'CharIn' Name '(' Punctuation 'Trim' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ',' Operator ' ' Text 'AllChars' Name ' ' Text '-' Operator ' ' Text '[' Punctuation "'" Literal.String '.' Literal.String "'" Literal.String '])' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Default' Keyword.Pseudo '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'FileName' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IsValidInteger' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text "{const\n LowInt = '2147483648';\n HighInt = '2147483647';\nvar\n len, RealLen, i, o: Integer;\n c: Char;\nbegin\n Result := False;\n if S = '' then\n Exit;\n\n len := Length(S);\n o := 1;\n \n if S[1] = '-' then begin\n if len = 1 then\n Exit;\n Inc(o);\n while (o <= len) and (S[o] = '0') do\n Inc(o);\n if o > len then\n Exit;\n if o < len then begin\n RealLen := len - o + 1;\n if RealLen > Length(LowInt) then\n Exit\n else if RealLen = Length(LowInt) then begin\n for i := 1 to Length(LowInt) do begin\n c := S[i + o - 1];\n if (c < '0') or (c > LowInt[i]) then\n Exit;\n if c in ['0'..Char((Byte(LowInt[i])-1))] then\n Break;\n end;\n Inc(o, i);\n end;\n end;\n end else begin\n while (o <= len) and (S[o] = '0') do\n Inc(o);\n if o <= len then begin\n RealLen := len - o + 1;\n if RealLen > Length(HighInt) then\n Exit\n else if RealLen = Length(HighInt) then begin\n for i := 1 to Length(HighInt) do begin\n c := S[i + o - 1];\n if (c < '0') or (c > HighInt[i]) then\n Exit;\n if c in ['0'..Char((Byte(HighInt[i])-1))] then\n Break;\n end;\n Inc(o, i);\n end;\n end;\n end;\n\n for i := o to len do\n if not (S[i] in ['0'..'9']) then\n Exit;\n\n Result := True; }" Comment.Multiline '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Int64' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'StrToInt64Def' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Int64' Keyword.Type '))' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'i' Name ' ' Text '>' Operator '=' Operator ' ' Text 'Low' Name.Builtin '(' Punctuation 'Integer' Keyword.Type '))' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '<' Operator '=' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Integer' Keyword.Type '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IsValidCardinal' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text "{const\n HighCard = '4294967295';\nvar\n len, RealLen, i, o: Integer;\nbegin\n Result := False;\n if S = '' then\n Exit;\n\n len := Length(S);\n o := 1;\n \n while (o <= len) and (S[o] = '0') do\n Inc(o);\n if o <= len then begin\n RealLen := len - o + 1;\n if RealLen > Length(HighCard) then\n Exit\n else if RealLen = Length(HighCard) then begin\n for i := 1 to Length(HighCard) do begin\n if S[i + o - 1] > HighCard[i] then\n Exit;\n if S[i + o - 1] in ['0'..Char((Byte(HighCard[i])-1))] then\n Break;\n end;\n Inc(o, i);\n end;\n end;\n\n for i := o to len do\n if not (S[i] in ['0'..'9']) then\n Exit;\n\n Result := True; }" Comment.Multiline '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Int64' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'StrToInt64Def' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'i' Name ' ' Text '>' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '<' Operator '=' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Cardinal' Keyword.Type '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrOfBool' Name.Function '(' Punctuation 'flag' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator ' ' Text 'const' Keyword ' ' Text 'TrueStr' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String 'True' Literal.String "'" Literal.String ';' Operator '\n ' Text 'const' Keyword ' ' Text 'FalseStr' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String 'False' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Flag' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'TrueStr' Name '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'FalseStr' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'StrOfInt' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n' Text "{ if i = 0 then begin\n Result := '0';\n Exit end;\n\n while i > 0 do begin\n Result := Char(Byte('0') + (i mod 10)) + Result;\n i := i div 10;\n end;}" Comment.Multiline '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'IntToStr' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CardOfStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Res' Name ':' Operator ' ' Text 'Int64' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'StrToInt64Def' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Res' Name ' ' Text '>' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Cardinal' Keyword.Type ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Cardinal' Keyword.Type ')' Punctuation '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'Res' Name ' ' Text '<' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Cardinal' Keyword.Type '(' Punctuation 'Res' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'HexOrd' Name.Function '(' Punctuation 'Hex' Name ':' Operator ' ' Text 'Char' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'THex' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'case' Keyword ' ' Text 'Hex' Name ' ' Text 'of' Keyword '\n ' Text "'" Literal.String '0' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String '9' Literal.String "'" Literal.String ':' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation 'Hex' Name ')' Punctuation ' ' Text '-' Operator ' ' Text '48' Literal.Number.Integer ';' Operator '\n ' Text "'" Literal.String 'A' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String 'F' Literal.String "'" Literal.String ':' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation 'Hex' Name ')' Punctuation ' ' Text '-' Operator ' ' Text '55' Literal.Number.Integer ';' Operator '\n ' Text "'" Literal.String 'a' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String 'f' Literal.String "'" Literal.String ':' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation 'Hex' Name ')' Punctuation ' ' Text '-' Operator ' ' Text '87' Literal.Number.Integer ';' Operator '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ByteOfHex' Name.Function '(' Punctuation 'Hex' Name ':' Operator ' ' Text 'THexByteStr' Name ')' Punctuation ':' Operator ' ' Text 'Byte' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'HexOrd' Name '(' Punctuation 'Hex' Name '[' Punctuation '1' Literal.Number.Integer '])' Punctuation ' ' Text 'shl' Keyword ' ' Text '4' Literal.Number.Integer ')' Punctuation ' ' Text '+' Operator ' ' Text 'HexOrd' Name '(' Punctuation 'Hex' Name '[' Punctuation '2' Literal.Number.Integer '])' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'DecOfHex' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Hex' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'IntToStr' Name.Builtin '(' Punctuation 'CardOfHex' Name '(' Punctuation 'Hex' Name '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'HexOfByte' Name.Function '(' Punctuation 'b' Name ':' Operator ' ' Text 'Byte' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'THexByteStr' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'HexChar' Name '[(' Punctuation 'b' Name ' ' Text 'and' Keyword ' ' Text '$F0' Literal.Number.Hex ')' Punctuation ' ' Text 'shr' Keyword ' ' Text '4' Literal.Number.Integer ']' Punctuation '\n ' Text '+' Operator ' ' Text 'HexChar' Name '[' Punctuation ' ' Text 'b' Name ' ' Text 'and' Keyword ' ' Text '$0F' Literal.Number.Hex ' ' Text ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text "{function HexOfCard2(c: Cardinal): string;\nvar\n Data: array[0..(1 shl 4) - 1] of Char;\n i: Integer;\nbegin\n for i := 0 to (1 shl 4) - 1 do\n if i < 10 then\n Data[i] := Char(Ord('0') + i)\n else\n Data[i] := Char(Ord('A') + i - 10);\n\n Result := Data[(c and (((1 shl (1 shl 2)) - 1) shl (7 shl 2))) shr (7 shl 2)]\n + Data[(c and (((1 shl (1 shl 2)) - 1) shl (6 shl 2))) shr (6 shl 2)]\n + Data[(c and (((1 shl (1 shl 2)) - 1) shl (5 shl 2))) shr (5 shl 2)]\n + Data[(c and (((1 shl (1 shl 2)) - 1) shl (4 shl 2))) shr (4 shl 2)]\n + Data[(c and (((1 shl (1 shl 2)) - 1) shl (3 shl 2))) shr (3 shl 2)]\n + Data[(c and (((1 shl (1 shl 2)) - 1) shl (2 shl 2))) shr (2 shl 2)]\n + Data[(c and (((1 shl (1 shl 2)) - 1) shl (1 shl 2))) shr (1 shl 2)]\n + Data[(c and (((1 shl (1 shl 2)) - 1) shl (0 shl 2))) shr (0 shl 2)];\nend; }" Comment.Multiline '\n\n' Text 'function' Keyword ' ' Text 'HexOfCard' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'a' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'while' Keyword ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'a' Name ' ' Text ':' Operator '=' Operator ' ' Text 'i' Name ' ' Text 'and' Keyword ' ' Text '$F' Literal.Number.Hex ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'HexChar' Name '[' Punctuation 'a' Name ']' Punctuation ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'i' Name ' ' Text 'shr' Keyword ' ' Text '4' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'HexOfCard' Name.Function '(' Punctuation 'i' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator ' ' Text 'Digits' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'a' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'while' Keyword ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'a' Name ' ' Text ':' Operator '=' Operator ' ' Text 'i' Name ' ' Text 'and' Keyword ' ' Text '$F' Literal.Number.Hex ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'HexChar' Name '[' Punctuation 'a' Name ']' Punctuation ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'i' Name ' ' Text 'shr' Keyword ' ' Text '4' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'MulStr' Name '(' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String ',' Operator ' ' Text 'Digits' Name ' ' Text '-' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo '))' Punctuation ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'PascalHexArray' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'Name' Keyword.Pseudo ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ',' Operator ' ' Text 'len' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String 'const' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'EOL' Name ' ' Text '+' Operator '\n ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'Name' Name ' ' Text '+' Operator ' ' Text "'" Literal.String ': array[0..' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'IntToStr' Name.Builtin '(' Punctuation 'High' Name.Builtin '(' Punctuation 'a' Name '))' Punctuation ' ' Text '+' Operator ' ' Text "'" Literal.String '] of Byte = (' Literal.String "'" Literal.String ';' Operator '\n\n ' Text 'len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'a' Name ')' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'len' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text 'mod' Keyword ' ' Text '19' Literal.Number.Integer ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'EOL' Name ' ' Text '+' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text "'" Literal.String '$' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'HexOfByte' Name '(' Punctuation 'a' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'len' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text "'" Literal.String ',' Literal.String "'" Literal.String ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'EOL' Name ' ' Text '+' Operator ' ' Text "'" Literal.String ' );' Literal.String "'" Literal.String ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'HexOfByteA' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'Blocks' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Splitter' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Blocks' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'a' Name ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'HexOfByte' Name '(' Punctuation 'a' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'a' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'if' Keyword ' ' Text '((' Punctuation 'i' Name '+' Operator '1' Literal.Number.Integer ')' Punctuation ' ' Text 'mod' Keyword ' ' Text 'Blocks' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Splitter' Name ';' Operator '\n ' Text 'end' Keyword '\n ' Text 'else' Keyword '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'a' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'HexOfByte' Name '(' Punctuation 'a' Name '[' Punctuation 'i' Name '])' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BinOfByteA' Name.Function '(' Punctuation 'a' Name ':' Operator ' ' Text 'TByteA' Name ';' Operator ' ' Text 'Blocks' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '4' Literal.Number.Integer ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Splitter' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String ' ' Literal.String "'" Literal.String ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ',' Operator ' ' Text 'max' Name.Builtin ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'Bit' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'Blocks' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'max' Name.Builtin ' ' Text ':' Operator '=' Operator ' ' Text '8' Literal.Number.Integer ' ' Text '*' Operator ' ' Text '(' Punctuation 'High' Name.Builtin '(' Punctuation 'a' Name '))' Punctuation ' ' Text '+' Operator ' ' Text '7' Literal.Number.Integer ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'max' Name.Builtin ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Bit' Name ' ' Text ':' Operator '=' Operator ' ' Text '7' Literal.Number.Integer '-' Operator '(' Punctuation 'i' Name ' ' Text 'mod' Keyword ' ' Text '8' Literal.Number.Integer ')' Punctuation ' ' Text 'in' Keyword ' ' Text 'TBitSet' Name '(' Punctuation 'a' Name '[' Punctuation 'i' Name ' ' Text 'div' Keyword ' ' Text '8' Literal.Number.Integer '])' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Char' Keyword.Type '(' Punctuation 'Byte' Keyword.Type '(' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String ')' Punctuation ' ' Text '+' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation 'Bit' Name '))' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator ' ' Text 'max' Name.Builtin ' ' Text 'then' Keyword '\n ' Text 'if' Keyword ' ' Text '((' Punctuation 'i' Name '+' Operator '1' Literal.Number.Integer ')' Punctuation ' ' Text 'mod' Keyword ' ' Text 'Blocks' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Splitter' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'a' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Char' Keyword.Type '(' Punctuation 'Byte' Keyword.Type '(' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String ')' Punctuation ' ' Text '+' Operator ' ' Text 'a' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'shr' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text 'and' Keyword ' ' Text '8' Literal.Number.Integer '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'CardOfHex' Name.Function '(' Punctuation 'Hex' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Hex' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'ExtractChars' Name '(' Punctuation 'Hex' Name ',' Operator ' ' Text 'HexadecimalChars' Name ')' Punctuation ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text '8' Literal.Number.Integer ')' Punctuation ';' Operator '\n\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'Hex' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'Hex' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String '0' Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'HexOrd' Name '(' Punctuation 'Hex' Name '[' Punctuation 'i' Name '])' Punctuation ' ' Text 'shl' Keyword ' ' Text '((' Punctuation 'Length' Name.Builtin '(' Punctuation 'Hex' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'i' Name ')' Punctuation ' ' Text 'shl' Keyword ' ' Text '2' Literal.Number.Integer '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IntOfBin' Name.Function '(' Punctuation 'Bin' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Bin' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'ExtractChars' Name '(' Punctuation 'Bin' Name ',' Operator ' ' Text 'BinaryChars' Name ')' Punctuation ',' Operator ' ' Text '1' Literal.Number.Integer ',' Operator ' ' Text '32' Literal.Number.Integer ')' Punctuation ';' Operator '\n\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Bin' Name ')' Punctuation ' ' Text 'downto' Keyword ' ' Text '1' Literal.Number.Integer ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'Bin' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String '1' Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'shl' Keyword ' ' Text '(' Punctuation 'Length' Name.Builtin '(' Punctuation 'Bin' Name ')' Punctuation ' ' Text '-' Operator ' ' Text 'i' Name '))' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BinOfInt' Name.Function '(' Punctuation 'n' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'a' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '0' Literal.String "'" Literal.String ';' Operator '\n ' Text 'exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'while' Keyword ' ' Text 'n' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'a' Name ' ' Text ':' Operator '=' Operator ' ' Text 'n' Name ' ' Text 'and' Keyword ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Char' Keyword.Type '(' Punctuation 'a' Name ' ' Text '+' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String '))' Punctuation ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n ' Text 'n' Name ' ' Text ':' Operator '=' Operator ' ' Text 'n' Name ' ' Text 'shr' Keyword ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BinOfIntFill' Name.Function '(' Punctuation 'n' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator ' ' Text 'MinCount' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text '8' Literal.Number.Integer ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'a' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'n' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'MulStr' Name '(' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String ',' Operator ' ' Text 'MinCount' Name ')' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'while' Keyword ' ' Text 'n' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'a' Name ' ' Text ':' Operator '=' Operator ' ' Text 'n' Name ' ' Text 'and' Keyword ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Char' Keyword.Type '(' Punctuation 'a' Name ' ' Text '+' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String '))' Punctuation ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n ' Text 'n' Name ' ' Text ':' Operator '=' Operator ' ' Text 'n' Name ' ' Text 'shr' Keyword ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'MulStr' Name '(' Punctuation "'" Literal.String '0' Literal.String "'" Literal.String ',' Operator ' ' Text 'MinCount' Name ' ' Text '-' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo '))' Punctuation ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'BaseNOfInt' Name.Function '(' Punctuation 'I' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'TBaseN' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'a' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'B' Name ' ' Text '<' Operator ' ' Text '2' Literal.Number.Integer ')' Punctuation ' ' Text 'or' Keyword ' ' Text '(' Punctuation 'i' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String '0' Literal.String "'" Literal.String ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'while' Keyword ' ' Text 'i' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'a' Name ' ' Text ':' Operator '=' Operator ' ' Text 'i' Name ' ' Text 'mod' Keyword ' ' Text 'B' Name ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'BaseNChar' Name '[' Punctuation 'a' Name ']' Punctuation ' ' Text '+' Operator ' ' Text 'Result' Name.Builtin.Pseudo ';' Operator '\n ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'i' Name ' ' Text 'div' Keyword ' ' Text 'B' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'IntOfBaseN' Name.Function '(' Punctuation 'V' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'TBaseN' Name ')' Punctuation ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'F' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ';' Operator '\n ' Text 'c' Name ':' Operator ' ' Text 'Byte' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'V' Name ' ' Text ':' Operator '=' Operator ' ' Text 'TrimAll' Name '(' Punctuation 'V' Name ')' Punctuation ';' Operator '\n ' Text 'F' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'V' Name ')' Punctuation ' ' Text 'downto' Keyword ' ' Text '1' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'c' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation 'UpCase' Name.Builtin '(' Punctuation 'V' Name '[' Punctuation 'i' Name ']))' Punctuation ';' Operator '\n ' Text 'case' Keyword ' ' Text 'Char' Keyword.Type '(' Punctuation 'c' Name ')' Punctuation ' ' Text 'of' Keyword '\n ' Text "'" Literal.String '0' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String '9' Literal.String "'" Literal.String ':' Operator ' ' Text 'c' Name ' ' Text ':' Operator '=' Operator ' ' Text 'c' Name ' ' Text '-' Operator ' ' Text '48' Literal.Number.Integer ';' Operator '\n ' Text "'" Literal.String 'A' Literal.String "'" Literal.String '.' Operator '.' Operator "'" Literal.String 'Z' Literal.String "'" Literal.String ':' Operator ' ' Text 'c' Name ' ' Text ':' Operator '=' Operator ' ' Text 'c' Name ' ' Text '-' Operator ' ' Text '55' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'if' Keyword ' ' Text 'c' Name ' ' Text '<' Operator ' ' Text 'B' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Byte' Keyword.Type '(' Punctuation 'c' Name ')' Punctuation ' ' Text '*' Operator ' ' Text 'F' Name ';' Operator '\n ' Text 'F' Name ' ' Text ':' Operator '=' Operator ' ' Text 'F' Name ' ' Text '*' Operator ' ' Text 'B' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'KeepIn' Name.Function '(' Punctuation 'i' Name ',' Operator ' ' Text 'Bottom' Name ',' Operator ' ' Text 'Top' Name ':' Operator ' ' Text 'Variant' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Variant' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'i' Name ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '>' Operator ' ' Text 'Top' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Top' Name '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator ' ' Text 'Bottom' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Bottom' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'InRange' Name.Function '(' Punctuation 'Value' Name ',' Operator ' ' Text 'Bottom' Name ',' Operator ' ' Text 'Top' Name ':' Operator ' ' Text 'Variant' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'Value' Name ' ' Text '>' Operator '=' Operator ' ' Text 'Bottom' Name ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'Value' Name ' ' Text '<' Operator '=' Operator ' ' Text 'Top' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'InStrictRange' Name.Function '(' Punctuation 'Value' Name ',' Operator ' ' Text 'Bottom' Name ',' Operator ' ' Text 'Top' Name ':' Operator ' ' Text 'Variant' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'Value' Name ' ' Text '>' Operator ' ' Text 'Bottom' Name ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'Value' Name ' ' Text '<' Operator ' ' Text 'Top' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Min' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ',' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'A' Name ' ' Text '<' Operator ' ' Text 'B' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'A' Name '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'B' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Min' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ':' Operator ' ' Text 'TIntA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'A' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'A' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '<' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'A' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Max' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ',' Operator ' ' Text 'B' Name ':' Operator ' ' Text 'Integer' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'A' Name ' ' Text '>' Operator ' ' Text 'B' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'A' Name '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'B' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Max' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'A' Name ':' Operator ' ' Text 'TIntA' Name ')' Punctuation ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'A' Name '[' Punctuation '0' Literal.Number.Integer ']' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'A' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'A' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '>' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'A' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'RangesOfStr' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'TRanges' Name ';' Operator '\n' Text 'var' Keyword '\n ' Text 'SL' Name ':' Operator ' ' Text 'TStringList' Name ';' Operator '\n ' Text 'r' Name ',' Operator ' ' Text 'b' Name ',' Operator ' ' Text 't' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'i' Name ',' Operator ' ' Text 'p' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'function' Keyword ' ' Text 'TryStrToCard' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'out' Name ' ' Text 'Value' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n ' Text 'var' Keyword '\n ' Text 'E' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'Val' Name.Builtin '(' Punctuation 'S' Name ',' Operator ' ' Text 'Value' Name ',' Operator ' ' Text 'E' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'E' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'nil' Keyword ';' Operator '\n ' Text 'SL' Name ' ' Text ':' Operator '=' Operator ' ' Text 'TStringList' Name '.' Operator 'Create' Name ';' Operator '\n ' Text 'try' Keyword '\n ' Text 'Split' Name '(' Punctuation 'S' Name ',' Operator ' ' Text 'RangesSeparator' Name ',' Operator ' ' Text 'SL' Name ')' Punctuation ';' Operator '\n ' Text 'SetLength' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'SL' Name '.' Operator 'Count' Name ')' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'SL' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'r' Name ' ' Text ':' Operator '=' Operator ' ' Text 'SL' Name '[' Punctuation 'i' Name ']' Punctuation ';' Operator '\n ' Text 'with' Keyword ' ' Text 'Result' Name.Builtin.Pseudo '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation 'RangeInnerSeparator' Name ',' Operator ' ' Text 'r' Name ')' Punctuation ';' Operator '\n ' Text 'Simple' Name ' ' Text ':' Operator '=' Operator ' ' Text 'p' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator ' ' Text "// no '-' found" Comment.Single '\n ' Text 'if' Keyword ' ' Text 'Simple' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'r' Name ' ' Text '=' Operator ' ' Text 'RangeInfinite' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword ' ' Text '// * --> *-*' Comment.Single '\n ' Text 'Simple' Name ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'Bottom' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Low' Name.Builtin '(' Punctuation 'Bottom' Name ')' Punctuation ';' Operator '\n ' Text 'Top' Name ' ' Text ':' Operator '=' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Top' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'TryStrToCard' Name '(' Punctuation 'r' Name ',' Operator ' ' Text 'Value' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Break' Keyword ';' Operator '\n\n ' Text 'end' Keyword ' ' Text 'else' Keyword ' ' Text 'begin' Keyword '\n ' Text 'TileStr' Name '(' Punctuation 'r' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'p' Name ',' Operator ' ' Text 'b' Name ',' Operator ' ' Text 't' Name ')' Punctuation ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'b' Name ' ' Text '=' Operator ' ' Text 'RangeInfinite' Name ' ' Text 'then' Keyword '\n ' Text 'Bottom' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Low' Name.Builtin '(' Punctuation 'Bottom' Name ')' Punctuation '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'TryStrToCard' Name '(' Punctuation 'b' Name ',' Operator ' ' Text 'Bottom' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Break' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 't' Name ' ' Text '=' Operator ' ' Text 'RangeInfinite' Name ' ' Text 'then' Keyword '\n ' Text 'Top' Name ' ' Text ':' Operator '=' Operator ' ' Text 'High' Name.Builtin '(' Punctuation 'Top' Name ')' Punctuation '\n ' Text 'else' Keyword ' ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'TryStrToCard' Name '(' Punctuation 't' Name ',' Operator ' ' Text 'Top' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Break' Keyword ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Bottom' Name ' ' Text '>' Operator ' ' Text 'Top' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'p' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Bottom' Name ';' Operator ' ' Text 'Bottom' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Top' Name ';' Operator ' ' Text 'Top' Name ' ' Text ':' Operator '=' Operator ' ' Text 'p' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'i' Name ' ' Text '<' Operator '>' Operator ' ' Text 'SL' Name '.' Operator 'Count' Name ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'nil' Keyword ';' Operator '\n\n ' Text 'finally' Keyword '\n ' Text 'SL' Name '.' Operator 'Free' Name ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'InRanges' Name.Function '(' Punctuation 'Ranges' Name ':' Operator ' ' Text 'TRanges' Name ';' Operator ' ' Text 'TestValue' Name ':' Operator ' ' Text 'Cardinal' Keyword.Type ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'True' Keyword ';' Operator '\n\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'High' Name.Builtin '(' Punctuation 'Ranges' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'with' Keyword ' ' Text 'Ranges' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text 'do' Keyword '\n ' Text 'if' Keyword ' ' Text 'Simple' Name ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'TestValue' Name ' ' Text '=' Operator ' ' Text 'Value' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ' ' Text 'else' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'InRange' Name.Builtin '(' Punctuation 'TestValue' Name ',' Operator ' ' Text 'Bottom' Name ',' Operator ' ' Text 'Top' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'WriteSL' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Prefix' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'const' Keyword ' ' Text 'Suffix' Name ':' Operator ' ' Text 'string' Keyword ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'i' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'for' Keyword ' ' Text 'i' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'Strings' Name '.' Operator 'Count' Name '-' Operator '1' Literal.Number.Integer ' ' Text 'do' Keyword '\n ' Text 'WriteLn' Name.Builtin '(' Punctuation 'Prefix' Name ' ' Text '+' Operator ' ' Text 'Strings' Name '[' Punctuation 'i' Name ']' Punctuation ' ' Text '+' Operator ' ' Text 'Suffix' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Success' Name.Function '(' Punctuation 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'ResultOnSuccess' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'ERROR_SUCCESS' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'Res' Name ' ' Text '=' Operator ' ' Text 'ResultOnSuccess' Name ')' Punctuation ';' Operator '\n ' Text 'LastSuccessRes' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Res' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Failure' Name.Function '(' Punctuation 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator ' ' Text 'ResultOnSuccess' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'ERROR_SUCCESS' Name ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'not' Keyword ' ' Text 'Success' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text 'ResultOnSuccess' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'ExpandString' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Len' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'P' Name ',' Operator ' ' Text 'Res' Name ':' Operator ' ' Text 'PChar' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'P' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PChar' Keyword.Type '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n ' Text 'Len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExpandEnvironmentStrings' Name '(' Punctuation 'P' Name ',' Operator ' ' Text 'nil' Keyword ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Len' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'GetMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'Len' Name ')' Punctuation ';' Operator '\n ' Text 'ExpandEnvironmentStrings' Name '(' Punctuation 'P' Name ',' Operator ' ' Text 'Res' Name ',' Operator ' ' Text 'Len' Name ')' Punctuation ';' Operator '\n\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Res' Name ';' Operator '\n ' Text 'FreeMem' Name.Builtin '(' Punctuation 'Res' Name ',' Operator ' ' Text 'Len' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FindAll' Name.Function '(' Punctuation 'Strings' Name ':' Operator ' ' Text 'TStrings' Name ';' Operator ' ' Text 'const' Keyword ' ' Text 'Mask' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'ScanSubDirs' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator ' ' Text 'Attributes' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'faFindEveryFile' Name ';' Operator '\n ' Text 'FileReturn' Name ':' Operator ' ' Text 'TFileNameFunc' Name ' ' Text '=' Operator ' ' Text 'nil' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Path' Name ',' Operator ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'ScanDir' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Path' Name ',' Operator ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'var' Keyword '\n ' Text 'PSR' Name ':' Operator ' ' Text 'TSearchRec' Name ';' Operator '\n ' Text 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'Add' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'S' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'S' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Strings' Name '.' Operator 'Add' Name '(' Punctuation 'S' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'begin' Keyword '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindFirst' Name.Builtin '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'FileName' Name ',' Operator ' ' Text 'Attributes' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'Success' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'Assigned' Name.Builtin '(' Punctuation 'FileReturn' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Add' Name '(' Punctuation 'FileReturn' Name '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name '))' Punctuation '\n ' Text 'else' Keyword '\n ' Text 'Add' Name '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ')' Punctuation ';' Operator '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindNext' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'ScanSubDirs' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindFirst' Name.Builtin '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '*' Literal.String "'" Literal.String ',' Operator ' ' Text 'faDirectory' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'Success' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Attr' Name ' ' Text 'and' Keyword ' ' Text 'faDirectory' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation '\n ' Text 'and' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Name' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String '.' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Name' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String '..' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'ScanDir' Name '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindNext' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'begin' Keyword '\n ' Text 'Strings' Name '.' Operator 'Clear' Name ';' Operator '\n ' Text 'Path' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractPath' Name '(' Punctuation 'Mask' Name ')' Punctuation ';' Operator '\n ' Text 'FileName' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractFileName' Name.Builtin '(' Punctuation 'Mask' Name ')' Punctuation ';' Operator '\n ' Text 'ScanDir' Name '(' Punctuation 'Path' Name ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Strings' Name '.' Operator 'Count' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FindAllFirst' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Mask' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'ScanSubDirs' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'Attributes' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'faFindEveryFile' Name ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Path' Name ',' Operator ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n ' Text 'function' Keyword ' ' Text 'ScanDir' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Path' Name ',' Operator ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n ' Text 'var' Keyword '\n ' Text 'PSR' Name ':' Operator ' ' Text 'TSearchRec' Name ';' Operator '\n ' Text 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'False' Keyword ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Success' Name '(' Punctuation 'FindFirst' Name.Builtin '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'FileName' Name ',' Operator ' ' Text 'Attributes' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'FindAllFirst' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'Exit' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'ScanSubDirs' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindFirst' Name.Builtin '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '*' Literal.String "'" Literal.String ',' Operator ' ' Text 'faDirectory' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'not' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text 'and' Keyword ' ' Text 'Success' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Attr' Name ' ' Text 'and' Keyword ' ' Text 'faDirectory' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation '\n ' Text 'and' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Name' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String '.' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Name' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String '..' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'ScanDir' Name '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindNext' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'Path' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractPath' Name '(' Punctuation 'Mask' Name ')' Punctuation ';' Operator '\n ' Text 'FileName' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractFileName' Name.Builtin '(' Punctuation 'Mask' Name ')' Punctuation ';' Operator '\n ' Text 'ScanDir' Name '(' Punctuation 'Path' Name ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'DeleteFiles' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Mask' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'ScanSubDirs' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ';' Operator '\n ' Text 'Attributes' Name ':' Operator ' ' Text 'Integer' Keyword.Type ' ' Text '=' Operator ' ' Text 'faFindEveryFile' Name ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Path' Name ',' Operator ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'ScanDir' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'Path' Name ',' Operator ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'var' Keyword '\n ' Text 'PSR' Name ':' Operator ' ' Text 'TSearchRec' Name ';' Operator '\n ' Text 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n\n ' Text 'procedure' Keyword ' ' Text 'TryDeleteFile' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n ' Text 'begin' Keyword '\n ' Text 'try' Keyword '\n ' Text 'DeleteFile' Name.Builtin '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ')' Punctuation ';' Operator '\n ' Text 'except' Keyword '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'begin' Keyword '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindFirst' Name.Builtin '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'FileName' Name ',' Operator ' ' Text 'Attributes' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'Success' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'TryDeleteFile' Name '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ')' Punctuation ';' Operator '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindNext' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'ScanSubDirs' Name ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindFirst' Name.Builtin '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '*' Literal.String "'" Literal.String ',' Operator ' ' Text 'faDirectory' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'while' Keyword ' ' Text 'Success' Name '(' Punctuation 'Res' Name ',' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Attr' Name ' ' Text 'and' Keyword ' ' Text 'faDirectory' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation '\n ' Text 'and' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Name' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String '.' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'PSR' Name '.' Operator 'Name' Name ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String '..' Literal.String "'" Literal.String ')' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'ScanDir' Name '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'TryDeleteFile' Name '(' Punctuation 'Path' Name ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FindNext' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Path' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractPath' Name '(' Punctuation 'Mask' Name ')' Punctuation ';' Operator '\n ' Text 'FileName' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractFileName' Name.Builtin '(' Punctuation 'Mask' Name ')' Punctuation ';' Operator '\n ' Text 'ScanDir' Name '(' Punctuation 'Path' Name ',' Operator ' ' Text 'FileName' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'GetFileNew' Name.Function '(' Punctuation 'FileName' Name ':' Operator ' ' Text 'string' Keyword ';' Operator ' ' Text 'NoFloppyDrives' Name ':' Operator ' ' Text 'Boolean' Keyword.Type ' ' Text '=' Operator ' ' Text 'True' Keyword ')' Punctuation ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Drive' Name ':' Operator ' ' Text 'string' Keyword ';' Operator '\n ' Text 'pf' Name ',' Operator ' ' Text 'pd' Name ',' Operator ' ' Text 'Len' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'PSR' Name ':' Operator ' ' Text 'TSearchRec' Name ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'FileName' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Trim' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Length' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ' ' Text '<' Operator ' ' Text '2' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Drive' Name ' ' Text ':' Operator '=' Operator ' ' Text 'ExtractDrive' Name '(' Punctuation 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'DirectoryExists' Name.Builtin '(' Punctuation 'Drive' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text 'NoFloppyDrives' Name ' ' Text 'and' Keyword ' ' Text '(' Punctuation 'Drive' Name '[' Punctuation '1' Literal.Number.Integer ']' Punctuation ' ' Text 'in' Keyword ' ' Text '[' Punctuation "'" Literal.String 'A' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String 'B' Literal.String "'" Literal.String '])' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n\n ' Text 'Len' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Drive' Name ';' Operator '\n ' Text 'pf' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Length' Name.Builtin '(' Punctuation 'Drive' Name ')' Punctuation ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'while' Keyword ' ' Text 'pf' Name ' ' Text '<' Operator '=' Operator ' ' Text 'Len' Name ' ' Text 'do' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'FileName' Name '[' Punctuation 'pf' Name ']' Punctuation ' ' Text '=' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'pf' Name ')' Punctuation ';' Operator '\n ' Text 'Continue' Keyword ';' Operator ' ' Text 'end' Keyword ';' Operator '\n\n ' Text 'pd' Name ' ' Text ':' Operator '=' Operator ' ' Text 'CharPos' Name '(' Punctuation "'" Literal.String '\\' Literal.String "'" Literal.String ',' Operator ' ' Text 'FileName' Name ',' Operator ' ' Text 'pf' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'pd' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text '0' Literal.Number.Integer '=' Operator 'FindFirst' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'FileName' Name ',' Operator ' ' Text 'pf' Name ',' Operator ' ' Text 'MaxInt' Name ')' Punctuation ',' Operator ' ' Text 'faFindEveryFile' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ' ' Text 'then' Keyword ' ' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ';' Operator '\n ' Text 'Break' Keyword ';' Operator ' ' Text 'end' Keyword ' ' Text 'else' Keyword ' ' Text 'begin' Keyword '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text '0' Literal.Number.Integer '=' Operator 'FindFirst' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'FileName' Name ',' Operator ' ' Text 'pf' Name ',' Operator ' ' Text 'MaxInt' Name ')' Punctuation ',' Operator ' ' Text 'faDirectory' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Break' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text '0' Literal.Number.Integer '=' Operator 'FindFirst' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'Copy' Name.Builtin '(' Punctuation 'FileName' Name ',' Operator ' ' Text 'pf' Name ',' Operator ' ' Text 'pd' Name ' ' Text '-' Operator ' ' Text 'pf' Name ')' Punctuation ',' Operator ' ' Text 'faDirectory' Name ',' Operator ' ' Text 'PSR' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '+' Operator ' ' Text 'PSR' Name '.' Operator 'Name' Name ' ' Text '+' Operator ' ' Text "'" Literal.String '\\' Literal.String "'" Literal.String '\n ' Text 'else' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n ' Text 'FindClose' Name.Builtin '(' Punctuation 'PSR' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Result' Name.Builtin.Pseudo ' ' Text '=' Operator ' ' Text "'" Literal.String "'" Literal.String ' ' Text 'then' Keyword '\n ' Text 'Break' Keyword ';' Operator '\n\n ' Text 'pf' Name ' ' Text ':' Operator '=' Operator ' ' Text 'pd' Name ' ' Text '+' Operator ' ' Text '1' Literal.Number.Integer ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'Result' Name.Builtin.Pseudo ' ' Text '<' Operator '>' Operator ' ' Text "'" Literal.String "'" Literal.String ')' Punctuation ' ' Text 'and' Keyword ' ' Text 'not' Keyword ' ' Text 'FileEx' Name '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'True' Keyword ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text "'" Literal.String "'" Literal.String ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'DateTimeOfFileTime' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileTime' Name ':' Operator ' ' Text 'TFileTime' Name ')' Punctuation ':' Operator ' ' Text 'TDateTime' Keyword.Type ';' Operator '\n' Text 'var' Keyword '\n ' Text 'LocalFileTime' Name ':' Operator ' ' Text 'TFileTime' Name ';' Operator '\n ' Text 'Res' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n\n ' Text 'FileTimeToLocalFileTime' Name '(' Punctuation 'FileTime' Name ',' Operator ' ' Text 'LocalFileTime' Name ')' Punctuation ';' Operator '\n ' Text 'if' Keyword ' ' Text 'not' Keyword ' ' Text 'FileTimeToDosDateTime' Name '(' Punctuation 'LocalFileTime' Name ',' Operator ' ' Text 'LongRec' Name '(' Punctuation 'Res' Name ')' Punctuation '.' Operator 'Hi' Name ',' Operator '\n ' Text 'LongRec' Name '(' Punctuation 'Res' Name ')' Punctuation '.' Operator 'Lo' Name ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Res' Name ' ' Text ':' Operator '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ';' Operator '\n\n ' Text 'if' Keyword ' ' Text '(' Punctuation 'Res' Name ' ' Text '=' Operator ' ' Text '-' Operator '1' Literal.Number.Integer ')' Punctuation ' ' Text 'or' Keyword ' ' Text '(' Punctuation 'Res' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ')' Punctuation ' ' Text 'then' Keyword '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'try' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'FileDateToDateTime' Name.Builtin '(' Punctuation 'Res' Name ')' Punctuation ';' Operator '\n ' Text 'except' Keyword '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'FileNew' Name.Function '(' Punctuation 'const' Keyword ' ' Text 'FileName' Name ':' Operator ' ' Text 'string' Keyword ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Handle' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Handle' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FileCreate' Name.Builtin '(' Punctuation 'FileName' Name ')' Punctuation ';' Operator '\n ' Text 'FileClose' Name.Builtin '(' Punctuation 'Handle' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Win32PlatformStr' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'const' Keyword '\n ' Text 'PlatformStrings' Name ':' Operator ' ' Text 'array' Keyword '[' Punctuation 'VER_PLATFORM_WIN32s' Name '.' Operator '.' Operator 'VER_PLATFORM_WIN32_NT' Name ']' Punctuation ' ' Text 'of' Keyword ' ' Text 'string' Keyword ' ' Text '=' Operator '\n ' Text '(' Punctuation "'" Literal.String 'VER_PLATFORM_WIN32s' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String 'VER_PLATFORM_WIN32_WINDOWS' Literal.String "'" Literal.String ',' Operator ' ' Text "'" Literal.String 'VER_PLATFORM_WIN32_NT' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'PlatformStrings' Name '[' Punctuation 'Win32Platform' Name ']' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'FullOSInfo' Name.Function ':' Operator ' ' Text 'string' Keyword ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Format' Name.Builtin '(' Punctuation '\n ' Text "'" Literal.String 'Platform: %s' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'EOL' Name ' ' Text '+' Operator '\n ' Text "'" Literal.String 'Version: %d.%d Build %d' Literal.String "'" Literal.String ' ' Text '+' Operator ' ' Text 'EOL' Name ' ' Text '+' Operator '\n ' Text "'" Literal.String 'CSD: %s' Literal.String "'" Literal.String ',' Operator '\n ' Text '[' Punctuation '\n ' Text 'Win32PlatformStr' Name ',' Operator '\n ' Text 'Win32MajorVersion' Name ',' Operator ' ' Text 'Win32MinorVersion' Name ',' Operator ' ' Text 'Win32BuildNumber' Name ',' Operator '\n ' Text 'Win32CSDVersion' Name '\n ' Text ']' Punctuation '\n ' Text ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Win9x' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Win32Platform' Name ' ' Text '=' Operator ' ' Text 'VER_PLATFORM_WIN32_WINDOWS' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'WinNT' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Win32Platform' Name ' ' Text '=' Operator ' ' Text 'VER_PLATFORM_WIN32_NT' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'Win2000' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '(' Punctuation 'Win32Platform' Name ' ' Text '=' Operator ' ' Text 'VER_PLATFORM_WIN32_NT' Name ')' Punctuation '\n ' Text 'and' Keyword ' ' Text '(' Punctuation 'Win32MajorVersion' Name ' ' Text '=' Operator ' ' Text '4' Literal.Number.Integer ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'WinXP' Name.Function ':' Operator ' ' Text 'Boolean' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text 'Win32MajorVersion' Name ' ' Text '>' Operator '=' Operator ' ' Text '5' Literal.Number.Integer ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'initialization' Keyword '\n ' Text 'MyDir' Name ' ' Text ':' Operator '=' Operator ' ' Text 'GetMyDir' Name ';' Operator '\n\n' Text 'end' Keyword '.' Operator '\n\n' Text 'unit' Keyword ' ' Text 'FifoStream' Name ';' Operator '\n\n' Text 'interface' Keyword '\n\n' Text 'uses' Keyword ' ' Text 'Classes' Name ',' Operator ' ' Text 'windows' Name ',' Operator ' ' Text 'Dialogs' Name ';' Operator '\n\n' Text 'const' Keyword '\n ' Text 'DefaultChunksize' Name ' ' Text '=' Operator ' ' Text '32768' Literal.Number.Integer ';' Operator ' ' Text '// 32kb per chunk as default.' Comment.Single '\n\n' Text 'type' Keyword '\n ' Text 'PMemChunk' Name ' ' Text '=' Operator ' ' Text '^' Operator 'TMemChunk' Name ';' Operator '\n ' Text 'TMemChunk' Name ' ' Text '=' Operator ' ' Text 'record' Keyword '\n ' Text 'Filled' Name ':' Operator ' ' Text 'Longword' Keyword.Type ';' Operator '\n ' Text 'Read' Name.Builtin ':' Operator ' ' Text 'Longword' Keyword.Type ';' Operator '\n ' Text 'Data' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n ' Text 'TFifo' Name ' ' Text '=' Operator ' ' Text 'class' Keyword '\n ' Text 'private' Keyword.Pseudo '\n ' Text 'FBuffers' Name ':' Operator ' ' Text 'TList' Name ';' Operator '\n ' Text 'FChunksize' Name ':' Operator ' ' Text 'Longword' Keyword.Type ';' Operator '\n ' Text 'FCritSect' Name ':' Operator ' ' Text 'TRTLCriticalSection' Name ';' Operator '\n ' Text 'FIsWinNT' Name ':' Operator ' ' Text 'boolean' Keyword.Type ';' Operator '\n ' Text 'FBytesInFifo' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ';' Operator '\n ' Text 'protected' Keyword.Pseudo '\n ' Text 'function' Keyword ' ' Text 'GetBytesInFifo' Name.Function ':' Operator ' ' Text 'LongWord' Keyword.Type ';' Operator '\n ' Text 'public' Keyword.Pseudo '\n ' Text 'constructor' Keyword ' ' Text 'Create' Name.Function ';' Operator '\n ' Text 'destructor' Keyword ' ' Text 'Destroy' Name.Function ';' Operator ' ' Text 'override' Keyword.Pseudo ';' Operator '\n ' Text 'procedure' Keyword ' ' Text 'Write' Name.Function '(' Punctuation 'Data' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator ' ' Text 'Size' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ')' Punctuation ';' Operator '\n ' Text 'procedure' Keyword ' ' Text 'Read' Name.Function '(' Punctuation 'Buff' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator ' ' Text 'var' Keyword ' ' Text 'ReqSize' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ')' Punctuation ';' Operator '\n ' Text 'procedure' Keyword ' ' Text 'PeekData' Name.Function '(' Punctuation 'Buff' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator ' ' Text 'var' Keyword ' ' Text 'ReqSize' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ')' Punctuation ';' Operator '\n ' Text 'published' Keyword.Pseudo '\n ' Text 'property' Keyword ' ' Text 'BytesInFifo' Name.Property ':' Operator ' ' Text 'LongWord' Keyword.Type ' ' Text 'read' Keyword.Pseudo ' ' Text 'FBytesInFifo' Name.Function ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n\n' Text 'implementation' Keyword '\n\n' Text 'constructor' Keyword ' ' Text 'TFifo' Name.Class '.' Operator 'Create' Name.Function ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'inherited' Keyword ';' Operator '\n ' Text 'FBuffers' Name ' ' Text ':' Operator '=' Operator ' ' Text 'TList' Name '.' Operator 'Create' Name ';' Operator '\n ' Text '// set default chunksize...' Comment.Single '\n ' Text 'FChunksize' Name ' ' Text ':' Operator '=' Operator ' ' Text 'DefaultChunksize' Name ';' Operator '\n ' Text 'InitializeCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'destructor' Keyword ' ' Text 'TFifo' Name.Class '.' Operator 'Destroy' Name.Function ';' Operator '\n' Text 'var' Keyword '\n ' Text 'I' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'EnterCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n ' Text 'for' Keyword ' ' Text 'I' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'to' Keyword ' ' Text 'FBuffers' Name '.' Operator 'count' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'do' Keyword '\n ' Text 'begin' Keyword '\n ' Text 'FreeMem' Name.Builtin '(' Punctuation 'PMemChunk' Name '(' Punctuation 'Fbuffers' Name '[' Punctuation 'I' Name '])' Punctuation '.' Operator 'Data' Name ')' Punctuation ';' Operator '\n ' Text 'Dispose' Keyword '(' Punctuation 'PMemChunk' Name '(' Punctuation 'Fbuffers' Name '[' Punctuation 'I' Name ']))' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'FBuffers' Name '.' Operator 'Clear' Name ';' Operator '\n ' Text 'FBuffers' Name '.' Operator 'Free' Name ';' Operator '\n ' Text 'LeaveCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n\n ' Text 'DeleteCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n ' Text 'inherited' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'function' Keyword ' ' Text 'TFifo' Name.Class '.' Operator 'GetBytesInFifo' Name.Function ':' Operator ' ' Text 'LongWord' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'Result' Name.Builtin.Pseudo ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'if' Keyword ' ' Text 'FBuffers' Name '.' Operator 'Count' Name ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword '\n ' Text 'exit' Keyword ';' Operator '\n ' Text 'end' Keyword '\n ' Text 'else' Keyword '\n ' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'FBuffers' Name '.' Operator 'Count' Name ' ' Text '>' Operator ' ' Text '1' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text '(' Punctuation 'FBuffers' Name '.' Operator 'Count' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer ')' Punctuation ' ' Text '*' Operator ' ' Text 'FChunkSize' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'PMemChunk' Name '(' Punctuation 'FBuffers' Name '[' Punctuation 'Fbuffers' Name '.' Operator 'Count' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer '])' Punctuation '.' Operator 'Filled' Name ')' Punctuation ';' Operator '\n ' Text 'Dec' Name.Builtin '(' Punctuation 'Result' Name.Builtin.Pseudo ',' Operator ' ' Text 'PMemChunk' Name '(' Punctuation 'FBuffers' Name '[' Punctuation '0' Literal.Number.Integer '])' Punctuation '.' Operator 'Read' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'TFifo' Name.Class '.' Operator 'Write' Name.Function '(' Punctuation 'Data' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator ' ' Text 'Size' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'Privpointer' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator '\n ' Text 'PrivSize' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ';' Operator '\n ' Text 'Chunk' Name ':' Operator ' ' Text 'PMemChunk' Name ';' Operator '\n ' Text 'PosInChunk' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'LongWord' Keyword.Type '(' Punctuation 'Data' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword '\n ' Text '// null pointer? somebody is trying to fool us, get out...' Comment.Single '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'EnterCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n ' Text 'PrivPointer' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Data' Name ';' Operator '\n ' Text 'PrivSize' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text '// are already buffers there?' Comment.Single '\n ' Text 'if' Keyword ' ' Text 'FBuffers' Name '.' Operator 'count' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword '\n ' Text '// is the last one of them not completely filled?' Comment.Single '\n ' Text 'if' Keyword ' ' Text 'PMemChunk' Name '(' Punctuation 'FBuffers' Name '[' Punctuation 'FBuffers' Name '.' Operator 'count' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer '])' Punctuation '.' Operator 'filled' Name ' ' Text '<' Operator ' ' Text 'FChunksize' Name ' ' Text 'then' Keyword '\n ' Text '// not completely filled, so fill up the buffer.' Comment.Single '\n ' Text 'begin' Keyword '\n ' Text 'Chunk' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PMemChunk' Name '(' Punctuation 'FBuffers' Name '[' Punctuation 'FBuffers' Name '.' Operator 'count' Name ' ' Text '-' Operator ' ' Text '1' Literal.Number.Integer '])' Punctuation ';' Operator '\n ' Text '// fetch chunkdata.' Comment.Single '\n ' Text 'PosInChunk' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Chunk' Name '.' Operator 'Data' Name ';' Operator '\n ' Text '// move to current fill pos...' Comment.Single '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'LongWord' Keyword.Type '(' Punctuation 'PosInChunk' Name ')' Punctuation ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ')' Punctuation ';' Operator '\n ' Text '// can we fill the chunk completely?' Comment.Single '\n ' Text 'if' Keyword ' ' Text 'Size' Name ' ' Text '>' Operator ' ' Text 'FChunksize' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword '\n ' Text '// yes we can.' Comment.Single '\n ' Text 'Move' Name.Builtin '(' Punctuation 'PrivPointer' Name '^' Operator ',' Operator ' ' Text 'PosInChunk' Name '^' Operator ',' Operator ' ' Text 'FChunksize' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'FChunksize' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'LongWord' Keyword.Type '(' Punctuation 'PrivPointer' Name ')' Punctuation ',' Operator ' ' Text 'FChunksize' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ')' Punctuation ';' Operator '\n ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FChunkSize' Name ';' Operator '\n ' Text 'end' Keyword '\n ' Text 'else' Keyword '\n ' Text '// we have to less data for filling the chunk completely,' Comment.Single '\n ' Text '// just put everything in.' Comment.Single '\n ' Text 'begin' Keyword '\n ' Text 'Move' Name.Builtin '(' Punctuation 'PrivPointer' Name '^' Operator ',' Operator ' ' Text 'PosInChunk' Name '^' Operator ',' Operator ' ' Text 'Size' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'Size' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Chunk' Name '.' Operator 'Filled' Name ',' Operator ' ' Text 'Size' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text '// as long as we have remaining stuff put it into new chunks.' Comment.Single '\n ' Text 'while' Keyword ' ' Text '(' Punctuation 'PrivSize' Name ' ' Text '<' Operator ' ' Text 'Size' Name ')' Punctuation ' ' Text 'do' Keyword '\n ' Text 'begin' Keyword '\n ' Text 'new' Keyword '(' Punctuation 'Chunk' Name ')' Punctuation ';' Operator '\n ' Text 'GetMem' Name.Builtin '(' Punctuation 'Chunk' Name '.' Operator 'Data' Name ',' Operator ' ' Text 'FChunksize' Name ')' Punctuation ';' Operator '\n ' Text 'Chunk' Name '.' Operator 'Read' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text '// can we fill an entire chunk with the remaining data?' Comment.Single '\n ' Text 'if' Keyword ' ' Text 'Privsize' Name ' ' Text '+' Operator ' ' Text 'FChunksize' Name ' ' Text '<' Operator ' ' Text 'Size' Name ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword '\n ' Text '// yes we can, so put the stuff in.' Comment.Single '\n ' Text 'Move' Name.Builtin '(' Punctuation 'Privpointer' Name '^' Operator ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Data' Name '^' Operator ',' Operator ' ' Text 'FChunksize' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'LongWord' Keyword.Type '(' Punctuation 'PrivPointer' Name ')' Punctuation ',' Operator ' ' Text 'FChunksize' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'FChunksize' Name ')' Punctuation ';' Operator '\n ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text ':' Operator '=' Operator ' ' Text 'FChunksize' Name ';' Operator '\n ' Text 'end' Keyword '\n ' Text 'else' Keyword ' ' Text '// we have to less data to fill the entire chunk, just put the remaining stuff in.' Comment.Single '\n ' Text 'begin' Keyword '\n ' Text 'Move' Name.Builtin '(' Punctuation 'Privpointer' Name '^' Operator ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Data' Name '^' Operator ',' Operator ' ' Text 'Size' Name ' ' Text '-' Operator ' ' Text 'Privsize' Name ')' Punctuation ';' Operator '\n ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Size' Name ' ' Text '-' Operator ' ' Text 'Privsize' Name ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'Size' Name ' ' Text '-' Operator ' ' Text 'Privsize' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'Fbuffers' Name '.' Operator 'Add' Name '(' Punctuation 'Chunk' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'if' Keyword ' ' Text 'Size' Name ' ' Text '<' Operator '>' Operator ' ' Text 'Privsize' Name ' ' Text 'then' Keyword '\n ' Text 'Showmessage' Name '(' Punctuation "'" Literal.String 'miscalculation in TFifo.write' Literal.String "'" Literal.String ')' Punctuation ';' Operator '\n ' Text 'FBytesInFifo' Name ' ' Text ':' Operator '=' Operator ' ' Text 'GetBytesInFifo' Name ';' Operator '\n ' Text 'LeaveCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'procedure' Keyword ' ' Text 'TFifo' Name.Class '.' Operator 'Read' Name.Function '(' Punctuation 'Buff' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator ' ' Text 'var' Keyword ' ' Text 'ReqSize' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'PrivSize' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'Privpos' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator '\n ' Text 'Chunk' Name ':' Operator ' ' Text 'PMemChunk' Name ';' Operator '\n ' Text 'ChunkPos' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'LongWord' Keyword.Type '(' Punctuation 'Buff' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword '\n ' Text '// null pointer? somebody is trying to fool us, get out...' Comment.Single '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'EnterCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n ' Text 'PrivSize' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Privpos' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Buff' Name ';' Operator '\n ' Text 'while' Keyword ' ' Text 'FBuffers' Name '.' Operator 'Count' Name ' ' Text '>' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'do' Keyword '\n ' Text 'begin' Keyword '\n ' Text 'Chunk' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PMemChunk' Name '(' Punctuation 'FBuffers' Name '[' Punctuation '0' Literal.Number.Integer '])' Punctuation ';' Operator '\n ' Text 'ChunkPos' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Chunk' Name '.' Operator 'data' Name ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'LongWord' Keyword.Type '(' Punctuation 'ChunkPos' Name ')' Punctuation ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Read' Name ')' Punctuation ';' Operator '\n ' Text '// does the remaining part of the chunk fit into the buffer?' Comment.Single '\n ' Text 'if' Keyword ' ' Text 'PrivSize' Name ' ' Text '+' Operator ' ' Text '(' Punctuation 'Chunk' Name '.' Operator 'Filled' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'read' Name ')' Punctuation ' ' Text '<' Operator ' ' Text 'ReqSize' Name ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword ' ' Text '// yep, it fits' Comment.Single '\n ' Text 'Move' Name.Builtin '(' Punctuation 'ChunkPos' Name '^' Operator ',' Operator ' ' Text 'Privpos' Name '^' Operator ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'read' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'read' Name ')' Punctuation ';' Operator '\n ' Text 'FreeMem' Name.Builtin '(' Punctuation 'Chunk' Name '.' Operator 'Data' Name ')' Punctuation ';' Operator '\n ' Text 'Dispose' Keyword '(' Punctuation 'Chunk' Name ')' Punctuation ';' Operator '\n ' Text 'FBuffers' Name '.' Operator 'Delete' Name '(' Punctuation '0' Literal.Number.Integer ')' Punctuation ';' Operator '\n ' Text 'end' Keyword '\n ' Text 'else' Keyword ' ' Text "// remaining part didn't fit, get as much as we can and increment the" Comment.Single '\n ' Text '// read attribute.' Comment.Single '\n ' Text 'begin' Keyword '\n ' Text 'Move' Name.Builtin '(' Punctuation 'ChunkPos' Name '^' Operator ',' Operator ' ' Text 'Privpos' Name '^' Operator ',' Operator ' ' Text 'ReqSize' Name ' ' Text '-' Operator ' ' Text 'PrivSize' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'Chunk' Name '.' Operator 'read' Name ',' Operator ' ' Text 'ReqSize' Name ' ' Text '-' Operator ' ' Text 'PrivSize' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'ReqSize' Name ' ' Text '-' Operator ' ' Text 'PrivSize' Name ')' Punctuation ';' Operator '\n ' Text "// as we filled the buffer, we'll have to break here." Comment.Single '\n ' Text 'break' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'FBytesInFifo' Name ' ' Text ':' Operator '=' Operator ' ' Text 'GetBytesInFifo' Name ';' Operator '\n ' Text 'LeaveCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n ' Text 'ReqSize' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PrivSize' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text '// read Data from Stream without removing it from the Stream...' Comment.Single '\n\n' Text 'procedure' Keyword ' ' Text 'TFifo' Name.Class '.' Operator 'PeekData' Name.Function '(' Punctuation 'Buff' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator ' ' Text 'var' Keyword ' ' Text 'ReqSize' Name ':' Operator ' ' Text 'LongWord' Keyword.Type ')' Punctuation ';' Operator '\n' Text 'var' Keyword '\n ' Text 'PrivSize' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n ' Text 'Privpos' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator '\n ' Text 'Chunk' Name ':' Operator ' ' Text 'PMemChunk' Name ';' Operator '\n ' Text 'ChunkPos' Name ':' Operator ' ' Text 'pointer' Keyword.Type ';' Operator '\n ' Text 'ChunkNr' Name ':' Operator ' ' Text 'Integer' Keyword.Type ';' Operator '\n' Text 'begin' Keyword '\n ' Text 'if' Keyword ' ' Text 'LongWord' Keyword.Type '(' Punctuation 'Buff' Name ')' Punctuation ' ' Text '=' Operator ' ' Text '0' Literal.Number.Integer ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword '\n ' Text '// null pointer? somebody is trying to fool us, get out...' Comment.Single '\n ' Text 'Exit' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'EnterCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n ' Text 'PrivSize' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'Privpos' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Buff' Name ';' Operator '\n ' Text 'ChunkNr' Name ' ' Text ':' Operator '=' Operator ' ' Text '0' Literal.Number.Integer ';' Operator '\n ' Text 'while' Keyword ' ' Text 'FBuffers' Name '.' Operator 'Count' Name ' ' Text '>' Operator ' ' Text 'ChunkNr' Name ' ' Text 'do' Keyword '\n ' Text 'begin' Keyword '\n ' Text 'Chunk' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PMemChunk' Name '(' Punctuation 'FBuffers' Name '[' Punctuation 'ChunkNr' Name '])' Punctuation ';' Operator '\n ' Text 'ChunkPos' Name ' ' Text ':' Operator '=' Operator ' ' Text 'Chunk' Name '.' Operator 'data' Name ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'LongWord' Keyword.Type '(' Punctuation 'ChunkPos' Name ')' Punctuation ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Read' Name ')' Punctuation ';' Operator '\n ' Text '// does the remaining part of the chunk fit into the buffer?' Comment.Single '\n ' Text 'if' Keyword ' ' Text 'PrivSize' Name ' ' Text '+' Operator ' ' Text '(' Punctuation 'Chunk' Name '.' Operator 'Filled' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'read' Name ')' Punctuation ' ' Text '<' Operator ' ' Text 'ReqSize' Name ' ' Text 'then' Keyword '\n ' Text 'begin' Keyword ' ' Text '// yep, it fits' Comment.Single '\n ' Text 'Move' Name.Builtin '(' Punctuation 'ChunkPos' Name '^' Operator ',' Operator ' ' Text 'Privpos' Name '^' Operator ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'read' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'Chunk' Name '.' Operator 'Filled' Name ' ' Text '-' Operator ' ' Text 'Chunk' Name '.' Operator 'read' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'ChunkNr' Name ')' Punctuation ';' Operator '\n ' Text 'end' Keyword '\n ' Text 'else' Keyword ' ' Text "// remaining part didn't fit, get as much as we can and increment the" Comment.Single '\n ' Text '// read attribute.' Comment.Single '\n ' Text 'begin' Keyword '\n ' Text 'Move' Name.Builtin '(' Punctuation 'ChunkPos' Name '^' Operator ',' Operator ' ' Text 'Privpos' Name '^' Operator ',' Operator ' ' Text 'ReqSize' Name ' ' Text '-' Operator ' ' Text 'PrivSize' Name ')' Punctuation ';' Operator '\n ' Text 'Inc' Name.Builtin '(' Punctuation 'PrivSize' Name ',' Operator ' ' Text 'ReqSize' Name ' ' Text '-' Operator ' ' Text 'PrivSize' Name ')' Punctuation ';' Operator '\n ' Text "// as we filled the buffer, we'll have to break here." Comment.Single '\n ' Text 'break' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'end' Keyword ';' Operator '\n ' Text 'LeaveCriticalSection' Name '(' Punctuation 'FCritSect' Name ')' Punctuation ';' Operator '\n ' Text 'ReqSize' Name ' ' Text ':' Operator '=' Operator ' ' Text 'PrivSize' Name ';' Operator '\n' Text 'end' Keyword ';' Operator '\n\n' Text 'end' Keyword '.' Operator '\n' Text