Skip to content

Commit b940cbe

Browse files
committed
FIX: PARSE string using tag! doesn't consider the < and > when used with to block!
Fixes: metaeducation/rebol-issues#2138 (cherry picked from commit fc9fc9e)
1 parent 2231a1d commit b940cbe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/core/u-parse.c

+14
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,20 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
421421
if (!HAS_CASE(parse)) ch2 = UP_CASE(ch2);
422422
if (ch1 == ch2) goto found1;
423423
}
424+
else if (IS_TAG(item)) {
425+
ch2 = '<';
426+
if (ch1 == ch2) {
427+
// adapted from function Parse_To :-)
428+
REBSER *ser;
429+
ser = Copy_Form_Value(item, 0);
430+
i = Find_Str_Str(series, 0, index, series->tail, 1, ser, 0, ser->tail, AM_FIND_MATCH | parse->flags);
431+
if (i != NOT_FOUND) {
432+
if (is_thru) i += ser->tail;
433+
index = i;
434+
goto found;
435+
}
436+
}
437+
}
424438
else if (ANY_STR(item)) {
425439
ch2 = VAL_ANY_CHAR(item);
426440
if (!HAS_CASE(parse)) ch2 = UP_CASE(ch2);

0 commit comments

Comments
 (0)