LazUtils: Masks: TMask.Compile: do not call CompileRange when mocAnyCharOrNone is enabled, but mocRange and mocSet are disabled,

in taht case '[a' is a valid mask (of 2 literals).
This commit is contained in:
Bart 2021-11-03 19:14:22 +01:00
parent a9c7e4196b
commit 3d0b1cc901

View File

@ -951,8 +951,14 @@ begin
end;
'[':
begin
if [mocSet,mocRange,
mocAnyCharOrNone] * fMaskOpcodesAllowed <> []
if ([mocSet,mocRange,
mocAnyCharOrNone] * fMaskOpcodesAllowed <> [])
and not
(
([mocSet,mocRange]*fMaskOpCodesAllowed = []) //only mocAnyCharOrNone enabled
and
(fMaskInd<=fMaskLimit) and (fMask[fMaskInd+1]<>'?')// next char is not '?', so basically then the '[' is a literal (or an escapechar)
)
then
CompileRange
else begin