Skip to content

Commit 3b413fa

Browse files
committed
FIX: Remove the DO keyword from PARSE
fixes: Oldes/Rebol-issues#2083 related: Oldes/Rebol-issues#2085 DO rule was not working properly and as a confusing, I agree with Ladislav and disable it for now. (The current `Do_Eval_Rule` code can be enabled using the `USE_DO_PARSE_RULE` define)
1 parent b2e59dd commit 3b413fa

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/core/u-parse.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
559559
return i;
560560
}
561561

562-
562+
#ifdef USE_DO_PARSE_RULE
563+
//@@ https://github.com/Oldes/Rebol-issues/issues/2083
563564
/***********************************************************************
564565
**
565566
*/ static REBCNT Do_Eval_Rule(REBPARSE *parse, REBCNT index, REBVAL **rule)
@@ -653,7 +654,7 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
653654
UNSAVE_SERIES(newparse.series);
654655
return n;
655656
}
656-
657+
#endif // USE_DO_PARSE_RULE
657658

658659
/***********************************************************************
659660
**
@@ -931,13 +932,13 @@ void Print_Parse_Index(REBCNT type, REBVAL *rules, REBSER *series, REBCNT index)
931932
&& (Parse_Series(val, VAL_BLK_DATA(item), parse->flags, depth+1) == VAL_TAIL(val))
932933
) ? index+1 : NOT_FOUND;
933934
break;
934-
935+
#ifdef USE_DO_PARSE_RULE
935936
case SYM_DO:
936937
if (!IS_BLOCK_INPUT(parse)) goto bad_rule;
937938
i = Do_Eval_Rule(parse, index, &rules);
938939
rulen = 1;
939940
break;
940-
941+
#endif
941942
default:
942943
goto bad_rule;
943944
}

src/tests/units/parse-test.r3

+10
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,15 @@ Rebol [
6060

6161
===end-group===
6262

63+
===start-group=== "DO"
64+
65+
--test-- "issue-2083"
66+
;@@ https://github.com/Oldes/Rebol-issues/issues/2083
67+
;@@ https://github.com/Oldes/Rebol-issues/issues/2085
68+
--assert error? err: try [parse [1 + 1] [set result do integer!]]
69+
--assert err/id = 'parse-rule
70+
71+
===end-group===
72+
6373

6474
~~~end-file~~~

0 commit comments

Comments
 (0)