mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 13:10:53 +02:00
LazUtils: Masks: make CompileSpecialChars and CompileEscapeCharPlusLiteral methods of TMaskUtf8 instead of nested procs.
Note: code contains debug writeln's, so it will crash if no console is available.
This commit is contained in:
parent
e76d29f85b
commit
a0d01a5922
@ -220,6 +220,8 @@ type
|
||||
procedure AddLiteral;
|
||||
procedure AddRange(lFirstRange, lSecondRange: Integer);
|
||||
procedure CompileRange;
|
||||
procedure CompileEscapeCharPlusLiteral;
|
||||
procedure CompileSpecialChar;
|
||||
function GetMask: String; virtual;
|
||||
procedure ReverseRange(lFirstRange, lSecondRange: Integer);
|
||||
procedure SetMask(AValue: String); virtual;
|
||||
@ -912,9 +914,9 @@ begin
|
||||
Result := fOriginalMask;
|
||||
end;
|
||||
|
||||
procedure TMaskUTF8.Compile;
|
||||
procedure CompileEscapeCharPlusLiteral;
|
||||
begin
|
||||
|
||||
procedure TMaskUtf8.CompileEscapeCharPlusLiteral;
|
||||
begin
|
||||
inc(fMaskInd,fCPLength);
|
||||
if fMaskInd<=fMaskLimit then begin
|
||||
fCPLength:=UTF8CodepointSizeFast(@fMask[fMaskInd]);
|
||||
@ -923,10 +925,10 @@ procedure TMaskUTF8.Compile;
|
||||
end
|
||||
else
|
||||
Exception_IncompleteMask();
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure CompileSpecialChar;
|
||||
begin
|
||||
procedure TMaskUtf8.CompileSpecialChar;
|
||||
begin
|
||||
case fMask[fMaskInd] of
|
||||
'*':
|
||||
begin
|
||||
@ -978,13 +980,9 @@ procedure TMaskUTF8.Compile;
|
||||
CompileOtherSpecialChars;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
//****************************
|
||||
var
|
||||
junkbyte: Byte;
|
||||
junk: integer;
|
||||
//*****************************
|
||||
procedure TMaskUTF8.Compile;
|
||||
begin
|
||||
inherited Compile;
|
||||
//if Compile fails and a new call to Matches is made and Mask is unchanged
|
||||
|
Loading…
Reference in New Issue
Block a user