Skip to content

PARSE REMOVE COPY var rule doesn't copy #1244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Closed

PARSE REMOVE COPY var rule doesn't copy #1244

Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Labels
CC.resolved Issue with CureCode status built, tested or complete Status.important Test.written Type.bug Type.parse Parse related issues

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: Steeve

>> parse a: "12" [remove copy val skip] print [a val]
==2 none

So, the [remove] treats well the [skip], but discards the contents of [copy val].

Now, see:

>> parse a: "12" [remove [copy val skip]] print [a val]
== 2 1

The contents of [val] is preserved in that case, don't know why here, but not above...

>> parse a: "12" [remove copy val skip] reduce [a val]
== ["2" none]  ; should be ["2" "1"]

Imported from: CureCode [ Version: alpha 84 Type: Bug Platform: All Category: Parse Reproduce: Always Fixed-in:alpha 86 ]
Imported from: metaeducation#1244

Comments:

Rebolbot commented on Sep 30, 2009:

Submitted by: BrianH

My guess is that the remove is being performed before the copy. To be useful, the remove should be performed after the copy.


Rebolbot commented on Oct 5, 2009:

Submitted by: Carl

The example code now produces the required result.

However, note that the application order of COPY, SET, RETURN, REMOVE, INSERT, and CHANGE is fixed (in that order.)

These words are flags, not functions. (They don't push onto a stack, they simply set bit flags for processing after the rule is matched.)


Rebolbot added Type.bug and Status.important on Jan 12, 2016


@Siskin-Bot Siskin-Bot added the CC.resolved Issue with CureCode status built, tested or complete label May 22, 2020
@Oldes Oldes added Type.parse Parse related issues Test.written labels Mar 25, 2021
@Oldes Oldes closed this as completed Mar 25, 2021
Oldes added a commit to Siskin-framework/Rebol that referenced this issue Mar 26, 2021
Oldes added a commit to Siskin-framework/Rebol that referenced this issue Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CC.resolved Issue with CureCode status built, tested or complete Status.important Test.written Type.bug Type.parse Parse related issues
Projects
None yet
Development

No branches or pull requests

2 participants