mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 00:59:25 +02:00
LazUtils: only conditionally compile some checks in CompileAnyCharOrNone.
Note: code contains writeln's, so it will crash if no console is available.
This commit is contained in:
parent
4602ea4e19
commit
939c2d26d6
@ -17,6 +17,7 @@ unit Masks;
|
|||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
{$define debug_maskcompiled}
|
{$define debug_maskcompiled}
|
||||||
|
{$define debug_anycharornone}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@ -1020,17 +1021,18 @@ begin
|
|||||||
//if any of the 2 conditions is true, this procedure should not have been called.
|
//if any of the 2 conditions is true, this procedure should not have been called.
|
||||||
|
|
||||||
|
|
||||||
if fMask[fMaskInd]<>'[' then writeln('CompileAnyCharOrNone: expected [, found: ',fMask[fMaskInd]);
|
{$IFDEF debug_anycharornone}
|
||||||
|
|
||||||
if fMask[fMaskInd]<>'[' then
|
if fMask[fMaskInd]<>'[' then
|
||||||
Exception_InternalError();
|
Exception_InternalError();
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
Inc(fMaskInd); //consume the '['
|
Inc(fMaskInd); //consume the '['
|
||||||
|
|
||||||
if fMask[fMaskInd]<>'?' then writeln('CompileAnyCharOrNone: expected [, found: ',fMask[fMaskInd]);
|
|
||||||
|
|
||||||
|
{$IFDEF debug_anycharornone}
|
||||||
if fMask[fMaskInd]<>'?' then
|
if fMask[fMaskInd]<>'?' then
|
||||||
Exception_InternalError();
|
Exception_InternalError();
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
QCount:=1;
|
QCount:=1;
|
||||||
while (fMaskInd+QCount<=fMaskLimit) and (fMask[fMaskInd+QCount]='?') do Inc(QCount);
|
while (fMaskInd+QCount<=fMaskLimit) and (fMask[fMaskInd+QCount]='?') do Inc(QCount);
|
||||||
@ -1061,7 +1063,9 @@ begin
|
|||||||
Inc(fMatchMaximumLiteralBytes,QCount*4);
|
Inc(fMatchMaximumLiteralBytes,QCount*4);
|
||||||
Inc(fMaskInd,QCount); //go to ending ']'
|
Inc(fMaskInd,QCount); //go to ending ']'
|
||||||
|
|
||||||
|
{$IFDEF debug_anycharornone}
|
||||||
write('fMaskInd=',fMaskInd,', fMaskLimit=',fMaskLimit,' fMask[fMaskInd]=');if fMaskInd<=fMaskLimit then writeln('#',Ord(fMask[fMaskInd]),': ',fMask[fMaskInd])else writeln('>>');
|
write('fMaskInd=',fMaskInd,', fMaskLimit=',fMaskLimit,' fMask[fMaskInd]=');if fMaskInd<=fMaskLimit then writeln('#',Ord(fMask[fMaskInd]),': ',fMask[fMaskInd])else writeln('>>');
|
||||||
|
{$ENDIF}
|
||||||
writeln('CompileAnyCharOrNone end.');
|
writeln('CompileAnyCharOrNone end.');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user