Created
November 17, 2008 02:11
-
-
Save kamipo/25635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
use CSS::Tiny::Style (); | |
no warnings 'redefine'; | |
sub CSS::Tiny::Style::_sel_arr { | |
local $_ = shift; | |
my @d; | |
while ($_) { | |
my ($tag, $op); | |
# s/([a-zA-Z0-9.\#\*]+)\s*$//; $tag = $1; | |
s/([\w.\#\*\-\:]+)\s*$//; $tag = $1; | |
$op = $1 if (s/(\s*[+>]*\s*)$//); | |
push @d, $tag if $tag; | |
for ($op) { | |
/\+/ && do { push @d, 'left'; last; }; | |
/\>/ && do { push @d, 'parent'; last; }; | |
/^\s+$/ && do { push @d, 'lineage'; last; }; | |
} | |
} | |
return @d; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment