Skip to content
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

reset result on apply #55

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Conversation

funny-falcon
Copy link
Contributor

@funny-falcon funny-falcon commented Nov 2, 2022

It fixes duplicate production of previous rule application on non-producing entries:

rule_a = rule_b:b rule_c*:c { [b, c] }
rule_b = <"b"> { text }
rule_c = "c"

In example rule_c doesn't produce result, so result of rule_b is copied.

It first were mentioned in #41

After patch rule_c "produces" nil.

Fixes #41

It fixes duplicate production of previous rule application on
non-producing entries:

    rule_a = rule_b:b rule_c*:c { [b, c] }
    rule_b = <"b"> { text }
    rule_c = "c"

In example rule_c doesn't produce result, so result of rule_b is copied.

After this commit, rule_c produces nil.
@funny-falcon
Copy link
Contributor Author

I don't know if it desired behavior or not.
Certainly result of previous rule should not be copied, but should nil be produced instead, or there should be more complex logic to avoid result at all?

@evanphx evanphx merged commit 96b7c92 into evanphx:master Nov 2, 2022
@evanphx
Copy link
Owner

evanphx commented Nov 2, 2022

Thanks!

@funny-falcon funny-falcon deleted the reset_result branch November 7, 2022 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Items may be duplicated when a single item is followed by a * of items
2 participants