added css attribute extension

This commit is contained in:
Kyle Maxwell 2009-02-19 16:24:00 -08:00
parent be7a05d8ab
commit 48680adea3
5 changed files with 15 additions and 2 deletions

View File

@ -33,6 +33,7 @@ check-am:
@echo "function-magic..."; ./dexter test/function-magic.dex test/function-magic.html | diff test/function-magic.json - && echo " success."
@echo "malformed-expr..."; ./dexter test/malformed-expr.dex test/malformed-expr.html | diff test/malformed-expr.json - && echo " success."
@echo "malformed-json..."; ./dexter test/malformed-json.dex test/malformed-json.html | diff test/malformed-json.json - && echo " success."
@echo "css_attr..."; ./dexter -x test/css_attr.dex test/css_attr.html | diff test/css_attr.json - && echo " success."
@echo "match..."; ./dexter -x test/match.dex test/match.xml | diff test/match.json - && echo " success."
@echo "position..."; ./dexter test/position.dex test/position.html | diff test/position.json - && echo " success."
@echo "remote..."; ./dexter test/remote.dex test/remote.html | diff test/remote.json - && echo " success."

View File

@ -409,10 +409,15 @@ NCName
;
selectors_group
: selector COMMA OptS selectors_group { $$ = astrcat4(".//", $1, "|", $4); }
| selector { $$ = astrcat(".//", $1); }
: attribute_extended_selector COMMA OptS selectors_group { $$ = astrcat4(".//", $1, "|", $4); }
| attribute_extended_selector { $$ = astrcat(".//", $1); }
;
attribute_extended_selector
: selector
| selector S AT NAME { $$ = astrcat3($1, "/@", $4); }
;
selector
: simple_selector_sequence combinator selector { $$ = astrcat3($1, $2, $3); }
| simple_selector_sequence

3
test/css_attr.dex Normal file
View File

@ -0,0 +1,3 @@
{
"foo": "body @foo"
}

3
test/css_attr.html Normal file
View File

@ -0,0 +1,3 @@
<html>
<body foo="bar"></body>
</html>

1
test/css_attr.json Normal file
View File

@ -0,0 +1 @@
{ "foo": "bar" }