REBOL3 tracker
  0.9.12 beta
Ticket #0001959 User: anonymous

Project:

Previous Next
rss
TypeBug Statuscomplete Date19-Feb-2013 20:35
Versionr3 master CategoryParse Submitted byBrianH
PlatformAll Severityminor Prioritynormal

Summary PARSE regression with THRU at end
Description A recently introduced regression to PARSE has popped up in recent builds. Apparently, when using the THRU operation to match a value, it is not succeeding when the match brings it to the end of the series. THRU END works. I've only tested with string parsing, as I haven't been able to construct a relevant expression with block parsing that is supposed to succeed, but doesn't. See the example code.

Found by Rebolek. 2.100.* versions are not affected, nor is R2.
Example code
>> parse "abcd" [thru "cd" end]
== false  ; should be true
>> parse "abcd" [thru "cd"]
== false  ; should be true, and it's not the fault of end
>> parse "abcd" [thru "abcd" | (print 'alt) 4 skip]
alt
== true  ; the (incorrect) backtracking was triggered, so it doesn't just stop parsing altogether
>> parse "abcd" [thru "ab" end | (print 'alt) 4 skip]
alt
== true  ; correct failure in this case, so end's behavior isn't affected

Assigned ton/a Fixed in- Last Update18-Aug-2013 13:35


Comments
(0003471)
abolka
20-Feb-2013 00:28

Oh well, I think that's another regression introduced by the original fix to #682. Unfortunately my fix for one regression caused by that fix didn't catch this second regression as well. I'm on to it.
(0003472)
Ladislav
20-Feb-2013 16:29

The description is not correct, in fact. The fact is that THRU does not find the string when it is at the end, i.e., the rule that fails to match in the above example is the THRU rule, not the END rule (the END rule is not even processed by PARSE, in fact).

Taking that into account, the test may look different not mentioning END at all.
(0003475)
abolka
20-Feb-2013 23:08

Right, it's THRU that fails here. The tests can be as simple as:

>> parse "abcd" [thru "cd"]
== false ;; Expected: true
(0003476)
BrianH
21-Feb-2013 01:34

Good catch, ticket adjusted accordingly.
(0003480)
abolka
21-Feb-2013 19:47

Fix submitted:
https://github.com/rebol/r3/pull/92
(0003481)
Ladislav
22-Feb-2013 14:36

In the core-tests suite.

Date User Field Action Change
18-Aug-2013 13:35 Ladislav Status Modified pending => complete
27-Feb-2013 00:41 BrianH Status Modified submitted => pending
22-Feb-2013 14:36 Ladislav Comment : 0003481 Added -
21-Feb-2013 19:47 abolka Comment : 0003480 Added -
21-Feb-2013 01:36 BrianH Description Modified -
21-Feb-2013 01:34 BrianH Comment : 0003476 Added -
21-Feb-2013 01:34 BrianH Code Modified -
21-Feb-2013 01:34 BrianH Description Modified -
21-Feb-2013 01:34 BrianH Summary Modified PARSE regression with THRU and END => PARSE regression with THRU at end
20-Feb-2013 23:08 abolka Comment : 0003475 Added -
20-Feb-2013 16:32 Ladislav Comment : 0003472 Modified -
20-Feb-2013 16:31 Ladislav Comment : 0003472 Modified -
20-Feb-2013 16:30 Ladislav Comment : 0003472 Modified -
20-Feb-2013 16:29 Ladislav Comment : 0003472 Modified -
20-Feb-2013 16:29 Ladislav Comment : 0003472 Added -
20-Feb-2013 00:28 abolka Comment : 0003471 Added -
19-Feb-2013 20:36 BrianH Code Modified -
19-Feb-2013 20:35 BrianH Code Modified -
19-Feb-2013 20:35 BrianH Description Modified -
19-Feb-2013 20:35 BrianH Ticket Added -