Skip to content

Commit

Permalink
FEAT: parse string! using any-string!
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Feb 17, 2021
1 parent f324a10 commit 552e2c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/u-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,11 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
index = (UP_CASE(VAL_CHAR(item)) == UP_CASE(GET_ANY_CHAR(series, index))) ? index+1 : NOT_FOUND;
break;

case REB_EMAIL:
case REB_STRING:
case REB_BINARY:
case REB_FILE:
case REB_URL:
case REB_EMAIL:
index = Find_Str_Str(series, 0, index, SERIES_TAIL(series), 1, VAL_SERIES(item), VAL_INDEX(item), VAL_LEN(item), flags);
break;

Expand All @@ -225,7 +227,7 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
break;
*/
case REB_TAG:
case REB_FILE:
case REB_REF:
// case REB_ISSUE:
// !! Can be optimized (w/o COPY)
ser = Copy_Form_Value(item, 0);
Expand Down Expand Up @@ -533,6 +535,7 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
if (ANY_BINSTR(item)) {
if (!IS_STRING(item) && !IS_BINARY(item)) {
// !!! Can this be optimized not to use COPY?
// O: It would require Find_Str_Tag, Find_Str_Ref
ser = Copy_Form_Value(item, 0);
i = Find_Str_Str(series, 0, index, series->tail, 1, ser, 0, ser->tail, HAS_CASE(parse));
if (i != NOT_FOUND && is_thru) i += ser->tail;
Expand Down

0 comments on commit 552e2c0

Please # to comment.