Open benibela opened 3 years ago
This is still broken
See also:
program Project1;
uses FLRE;
var
f: TFLRE;
begin
f := TFLRE.Create('^(?:\d+\d+\d+\d+)$', []);
writeln( f.DumpRegularExpression );
writeln(f.Test('1'));
writeln(f.Test('12'));
writeln(f.Test('123'));
writeln(f.Test('1234'));
writeln(f.Test('12345'));
end.
My PR #77 had fixed it
Perhaps it should be like this now:
function ConcatEqualPlus(const NodeLeftMightBecomeCat,PlusNodeRight:PFLRENode):PFLRENode;
begin
if (NodeLeftMightBecomeCat^.NodeType=ntPLUS)
// assigned(NodeLeftMightBecomeCat^.Right) and
// (PlusNodeRight^.NodeType=ntPLUS)
then begin
NodeLeftMightBecomeCat^.NodeType:=ntCAT;
NodeLeftMightBecomeCat^.Right:=PlusNodeRight;
result:=NodeLeftMightBecomeCat;
end else begin
result:=PlusNodeRight;
end;
end;
Subsequent
+
imply a minimal length of the string.These match, but should not: