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

Fix WB4 implementation #11

Open
kwantam opened this issue Dec 23, 2016 · 1 comment
Open

Fix WB4 implementation #11

kwantam opened this issue Dec 23, 2016 · 1 comment

Comments

@kwantam
Copy link
Member

kwantam commented Dec 23, 2016

Current WB3/WB4 impl is out of spec:

So my interpretation of WB4 was wrong. We have to apply it in order of precedence. Thus, we cannot transform the input before attempting to apply WB3 (and the previous rules). Only then do we transform, and at that point the previous rules can no longer be applied again.

@Manishearth
Copy link
Member

The reason this is tricky to implement is that the processing model in the spec is different than a simple iterator.

The spec basically says to go down the list, applying each rule in order. When applying a rule, you apply it simultaneously everywhere.

So we can't just apply WB3 and WB4 in order of precedence whilst iterating. During forward iteration, whilst applying WB4 we need to repeatedly check if WB3 would not apply, and reenter the loop if so. This gets more complicated during reverse iteration.

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

No branches or pull requests

2 participants