mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 22:59:21 +02:00
* Fix all warnings/hints
git-svn-id: trunk@39556 -
This commit is contained in:
parent
f575eafa1e
commit
a921002c49
@ -868,7 +868,7 @@ function RegExprSubExpressions (const ARegExpr : string;
|
|||||||
StackIdx, StackSz : PtrInt;
|
StackIdx, StackSz : PtrInt;
|
||||||
begin
|
begin
|
||||||
Result := 0; // no unbalanced brackets found at this very moment
|
Result := 0; // no unbalanced brackets found at this very moment
|
||||||
|
Modif:=0;
|
||||||
ASubExprs.Clear; // I don't think that adding to non empty list
|
ASubExprs.Clear; // I don't think that adding to non empty list
|
||||||
// can be useful, so I simplified algorithm to work only with empty list
|
// can be useful, so I simplified algorithm to work only with empty list
|
||||||
|
|
||||||
@ -1339,6 +1339,7 @@ function TRegExpr.GetMatchLen (Idx : integer) : PtrInt;
|
|||||||
|
|
||||||
function TRegExpr.GetMatch (Idx : integer) : RegExprString;
|
function TRegExpr.GetMatch (Idx : integer) : RegExprString;
|
||||||
begin
|
begin
|
||||||
|
Result:='';
|
||||||
if (Idx >= 0) and (Idx < NSUBEXP) and Assigned (fInputString)
|
if (Idx >= 0) and (Idx < NSUBEXP) and Assigned (fInputString)
|
||||||
and Assigned (startp [Idx]) and Assigned (endp [Idx])
|
and Assigned (startp [Idx]) and Assigned (endp [Idx])
|
||||||
and (endp [Idx] > startp[Idx])
|
and (endp [Idx] > startp[Idx])
|
||||||
@ -1705,7 +1706,7 @@ function TRegExpr.CompileRegExpr (exp : PRegExprChar) : boolean;
|
|||||||
flags : integer;
|
flags : integer;
|
||||||
begin
|
begin
|
||||||
Result := false; // life too dark
|
Result := false; // life too dark
|
||||||
|
flags:=0;
|
||||||
regparse := nil; // for correct error handling
|
regparse := nil; // for correct error handling
|
||||||
regexpbeg := exp;
|
regexpbeg := exp;
|
||||||
try
|
try
|
||||||
@ -1811,6 +1812,7 @@ function TRegExpr.ParseReg (paren : integer; var flagp : integer) : PRegExprChar
|
|||||||
flags : integer;
|
flags : integer;
|
||||||
SavedModifiers : integer;
|
SavedModifiers : integer;
|
||||||
begin
|
begin
|
||||||
|
flags:=0;
|
||||||
Result := nil;
|
Result := nil;
|
||||||
flagp := HASWIDTH; // Tentatively.
|
flagp := HASWIDTH; // Tentatively.
|
||||||
parno := 0; // eliminate compiler stupid warning
|
parno := 0; // eliminate compiler stupid warning
|
||||||
@ -1891,6 +1893,7 @@ function TRegExpr.ParseBranch (var flagp : integer) : PRegExprChar;
|
|||||||
ret, chain, latest : PRegExprChar;
|
ret, chain, latest : PRegExprChar;
|
||||||
flags : integer;
|
flags : integer;
|
||||||
begin
|
begin
|
||||||
|
flags:=0;
|
||||||
flagp := WORST; // Tentatively.
|
flagp := WORST; // Tentatively.
|
||||||
|
|
||||||
ret := EmitNode (BRANCH);
|
ret := EmitNode (BRANCH);
|
||||||
@ -1997,6 +2000,7 @@ function TRegExpr.ParsePiece (var flagp : integer) : PRegExprChar;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
flags:=0;
|
||||||
Result := ParseAtom (flags);
|
Result := ParseAtom (flags);
|
||||||
if Result = nil
|
if Result = nil
|
||||||
then EXIT;
|
then EXIT;
|
||||||
@ -2360,6 +2364,7 @@ function TRegExpr.ParseAtom (var flagp : integer) : PRegExprChar;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
flags:=0;
|
||||||
flagp := WORST; // Tentatively.
|
flagp := WORST; // Tentatively.
|
||||||
|
|
||||||
inc (regparse);
|
inc (regparse);
|
||||||
@ -2885,6 +2890,9 @@ function TRegExpr.MatchPrim (prog : PRegExprChar) : boolean;
|
|||||||
// recursion, in particular by going through "ordinary" nodes (that don't
|
// recursion, in particular by going through "ordinary" nodes (that don't
|
||||||
// need to know whether the rest of the match failed) by a loop instead of
|
// need to know whether the rest of the match failed) by a loop instead of
|
||||||
// by recursion.
|
// by recursion.
|
||||||
|
Type
|
||||||
|
TLoopStack = array [1 .. LoopStackMax] of integer;
|
||||||
|
|
||||||
var
|
var
|
||||||
scan : PRegExprChar; // Current node.
|
scan : PRegExprChar; // Current node.
|
||||||
next : PRegExprChar; // Next node.
|
next : PRegExprChar; // Next node.
|
||||||
@ -2895,13 +2903,13 @@ function TRegExpr.MatchPrim (prog : PRegExprChar) : boolean;
|
|||||||
nextch : REChar;
|
nextch : REChar;
|
||||||
BracesMin, BracesMax : PtrInt; // we use integer instead of TREBracesArg for better support */+
|
BracesMin, BracesMax : PtrInt; // we use integer instead of TREBracesArg for better support */+
|
||||||
{$IFDEF ComplexBraces}
|
{$IFDEF ComplexBraces}
|
||||||
SavedLoopStack : array [1 .. LoopStackMax] of integer; // :(( very bad for recursion
|
SavedLoopStack : TloopStack; // :(( very bad for recursion
|
||||||
SavedLoopStackIdx : integer; //###0.925
|
SavedLoopStackIdx : integer; //###0.925
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
scan := prog;
|
scan := prog;
|
||||||
|
SavedLoopStack:=Default(TLoopStack);
|
||||||
while scan <> nil do begin
|
while scan <> nil do begin
|
||||||
len := PRENextOff (AlignToPtr(scan + 1))^; //###0.932 inlined regnext
|
len := PRENextOff (AlignToPtr(scan + 1))^; //###0.932 inlined regnext
|
||||||
if len = 0
|
if len = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user