mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 19:29:34 +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+}
|
||||
{$define debug_maskcompiled}
|
||||
{$define debug_anycharornone}
|
||||
|
||||
interface
|
||||
|
||||
@ -1020,17 +1021,18 @@ begin
|
||||
//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
|
||||
Exception_InternalError();
|
||||
{$ENDIF}
|
||||
|
||||
Inc(fMaskInd); //consume the '['
|
||||
|
||||
if fMask[fMaskInd]<>'?' then writeln('CompileAnyCharOrNone: expected [, found: ',fMask[fMaskInd]);
|
||||
|
||||
{$IFDEF debug_anycharornone}
|
||||
if fMask[fMaskInd]<>'?' then
|
||||
Exception_InternalError();
|
||||
{$ENDIF}
|
||||
|
||||
QCount:=1;
|
||||
while (fMaskInd+QCount<=fMaskLimit) and (fMask[fMaskInd+QCount]='?') do Inc(QCount);
|
||||
@ -1061,7 +1063,9 @@ begin
|
||||
Inc(fMatchMaximumLiteralBytes,QCount*4);
|
||||
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('>>');
|
||||
{$ENDIF}
|
||||
writeln('CompileAnyCharOrNone end.');
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user