Support for parsing multiple CSS node tests.

This commit is contained in:
Yorick Peterse 2014-10-05 01:28:19 +02:00
parent b9a1f914bd
commit 773ff4ce45
1 changed files with 14 additions and 5 deletions

View File

@ -7,19 +7,28 @@ options no_result_var
rule rule
css css
: selectors { val[0] } : expression { val[0] }
| /* none */ { nil } | /* none */ { nil }
; ;
selectors expression
: selectors selector { val[0] << val[1] } : path
| selector { val[0] } | node_test
; ;
selector path_member
: node_test : node_test
; ;
path_members
: path_member path_member { [val[0], val[1]] }
| path_member path_members { [val[0], *val[1]] }
;
path
: path_members { s(:path, *val[0]) }
;
node_test node_test
: node_name { s(:test, *val[0]) } : node_name { s(:test, *val[0]) }
; ;