Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Implemented Comma Selectors

  • Loading branch information...
commit 0a071d12b0ccf0c1a8e8a63c94b29cacb1d3d5d9 1 parent 0de0e39
Brian Mavity authored

Showing 2 changed files with 8 additions and 7 deletions. Show diff stats Hide diff stats

  1. +2 1  src/cssSelector.ometa
  2. +6 6 tests/test.js
3  src/cssSelector.ometa
@@ -62,7 +62,8 @@ ometa CssSelector <: Parser {
62 62 CDC = '-' '-' '>',
63 63
64 64
65   - selectors_group = selector:s (COMMA S* selector)* -> { self.add(s); self },
  65 + selectors_group = selector:pre comma_separated_selector*:post -> { self.add(pre + post.join('')); self },
  66 + comma_separated_selector = COMMA S* selector:sel -> { ', ' + sel },
66 67 selector = simple_selector_sequence:sim (combined_sequence)*:additional -> { sim + additional.join('') },
67 68 combinator = PLUS:p S+ -> { p + ' ' }
68 69 | PLUS:p -> { p }
12 tests/test.js
@@ -205,13 +205,13 @@ vows.describe('Namespaced Attribute Selectors').addBatch({
205 205 }).run();
206 206
207 207
208   -/*
209   - def test_comma_selectors
210   - assert_selector_parses('E, F')
211   - assert_selector_parses('E F, G H')
212   - assert_selector_parses('E > F, G > H')
213   - end
  208 +vows.describe('Comma Selectors').addBatch({
  209 + 'E, F': shouldParse(),
  210 + 'E F, G H': shouldParse(),
  211 + 'E > F, G > H': shouldParse()
  212 +}).run();
214 213
  214 +/*
215 215 def test_selectors_with_newlines
216 216 assert_selector_parses("E,\nF")
217 217 assert_selector_parses("E\nF")

0 comments on commit 0a071d1

Please sign in to comment.
Something went wrong with that request. Please try again.