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

CSS parser expression fixes #446

Merged
merged 11 commits into from
Jun 2, 2016
Merged

Conversation

toad
Copy link
Contributor

@toad toad commented Dec 26, 2015

This goes a bit further than #445. It documents the syntax and limitations and also fixes some potentially confusing bugs in future parsing rules. It is not urgent. CSS tests pass.

It's an ID selector, not a general selector. Implementation next...
&& needs to consume all the words *and* all the verifiers. It means the
sub-verifiers must all occur, in any order; each may eat zero or more
contiguous words. Also note that words can't be null here.
A b expression is just a sequence of numbers separated by 'b''s. It may
not include anything else, as is obvious from the verifier method itself.
So the old code could incorrectly match 1b2a3b4 as a single b (&&)
expression, and then fail in the verifier. Note also that if we use
more complex patterns, && binds more strongly than ||, so it would be
wrong to allow this even if we could support it.
Similarly, 'a' (||) may only join numbered expressions. This was true
until 'b' (&&) was introduced. Simplify the code and make sure it is
still true: 1a2a3a4 is a valid || expression, but 1a2b3 is not valid at
all, just like 1b2a3.
@unixninja92
Copy link
Contributor

Inconsistant indentation

@nextgens nextgens merged commit 0d13ec9 into hyphanet:next Jun 2, 2016
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.

3 participants