Skip to content

Commit

Permalink
Implemented Comma Selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
bmavity committed Sep 28, 2010
1 parent 0de0e39 commit 0a071d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/cssSelector.ometa
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ ometa CssSelector <: Parser {
CDC = '-' '-' '>', 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('') }, selector = simple_selector_sequence:sim (combined_sequence)*:additional -> { sim + additional.join('') },
combinator = PLUS:p S+ -> { p + ' ' } combinator = PLUS:p S+ -> { p + ' ' }
| PLUS:p -> { p } | PLUS:p -> { p }
Expand Down
12 changes: 6 additions & 6 deletions tests/test.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ vows.describe('Namespaced Attribute Selectors').addBatch({
}).run(); }).run();




/* vows.describe('Comma Selectors').addBatch({
def test_comma_selectors 'E, F': shouldParse(),
assert_selector_parses('E, F') 'E F, G H': shouldParse(),
assert_selector_parses('E F, G H') 'E > F, G > H': shouldParse()
assert_selector_parses('E > F, G > H') }).run();
end


/*
def test_selectors_with_newlines def test_selectors_with_newlines
assert_selector_parses("E,\nF") assert_selector_parses("E,\nF")
assert_selector_parses("E\nF") assert_selector_parses("E\nF")
Expand Down

0 comments on commit 0a071d1

Please sign in to comment.