Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented Comma Selectors

  • Loading branch information...
commit 0a071d12b0ccf0c1a8e8a63c94b29cacb1d3d5d9 1 parent 0de0e39
@bmavity authored
Showing with 8 additions and 7 deletions.
  1. +2 −1  src/cssSelector.ometa
  2. +6 −6 tests/test.js
View
3  src/cssSelector.ometa
@@ -62,7 +62,8 @@ ometa CssSelector <: Parser {
CDC = '-' '-' '>',
- selectors_group = selector:s (COMMA S* selector)* -> { self.add(s); self },
+ selectors_group = selector:pre comma_separated_selector*:post -> { self.add(pre + post.join('')); self },
+ comma_separated_selector = COMMA S* selector:sel -> { ', ' + sel },
selector = simple_selector_sequence:sim (combined_sequence)*:additional -> { sim + additional.join('') },
combinator = PLUS:p S+ -> { p + ' ' }
| PLUS:p -> { p }
View
12 tests/test.js
@@ -205,13 +205,13 @@ vows.describe('Namespaced Attribute Selectors').addBatch({
}).run();
-/*
- def test_comma_selectors
- assert_selector_parses('E, F')
- assert_selector_parses('E F, G H')
- assert_selector_parses('E > F, G > H')
- end
+vows.describe('Comma Selectors').addBatch({
+ 'E, F': shouldParse(),
+ 'E F, G H': shouldParse(),
+ 'E > F, G > H': shouldParse()
+}).run();
+/*
def test_selectors_with_newlines
assert_selector_parses("E,\nF")
assert_selector_parses("E\nF")
Please sign in to comment.
Something went wrong with that request. Please try again.