CSS-SAC
view release on metacpan or search on metacpan
$RE_NAME = qr/
(?:(?:\\(?:(?:[a-fA-F0-9]{1,6}[\t\x20])|[\x32-\xff]))|[a-zA-Z\x80-\xff0-9-])+
/xs;
# matches a valid CSS ident (this may be wrong, needs testing)
$RE_IDENT = qr/
(?:(?:\\(?:(?:[a-fA-F0-9]{1,6}[\t\x20])|[ \x32-\xff]))|[a-zA-Z\x80-\xff])
(?:(?:\\(?:(?:[a-fA-F0-9]{1,6}[\t\x20])|[ \x32-\xff]))|[a-zA-Z\x80-\xff0-9_-])*
/xs;
# matches a unicode range
$RE_RANGE = qr/(?:
(?:U\+)
(?:
(?:[0-9a-fA-F]{1,6}-[0-9a-fA-F]{1,6})
|
(?:\?{1,6})
|
(?:[0-9a-fA-F](?:
(?:\?{0,5}|[0-9a-fA-F])(?:
(?:\?{0,4}|[0-9a-fA-F])(?:
$value = $1;
$text = 'number';
if ($value =~ m/\./) {
$type = REAL;
}
else {
$type = INTEGER;
}
}
# unicode range
elsif ($$css =~ s/^($RE_RANGE)//) {
$value = $1;
$text = 'unicode-range';
$type = UNICODERANGE;
}
# hex rgb
elsif ($$css =~ s/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})//) {
$value = $1;
$text = '#';
$type = RGBCOLOR;
}
lib/CSS/SAC/TestWriter.pm view on Meta::CPAN
$lu->is_type(FUNCTION) or $lu->is_type(RECT_FUNCTION)
) {
return $lu->FunctionName . '(' . $lu->Value . ')';
}
# inherit
elsif ($lu->is_type(INHERIT)) {
return 'inherit';
}
# ident, number, unicoderange
elsif ($lu->is_type(IDENT) or $lu->is_type(INTEGER) or
$lu->is_type(REAL) or $lu->is_type(UNICODERANGE)) {
return $lu->Value;
}
# string
elsif ($lu->is_type(STRING_VALUE)) {
return "'" . $lu->Value . "'";
}
lib/CSS/SAC/Writer.pm view on Meta::CPAN
$lu->is_type(FUNCTION) or $lu->is_type(RECT_FUNCTION)
) {
return $lu->FunctionName . '(' . $lu->Value . ')';
}
# inherit
elsif ($lu->is_type(INHERIT)) {
return 'inherit';
}
# ident, number, unicoderange
elsif ($lu->is_type(IDENT) or $lu->is_type(INTEGER) or
$lu->is_type(REAL) or $lu->is_type(UNICODERANGE)) {
return $lu->Value;
}
# string
elsif ($lu->is_type(STRING_VALUE)) {
return "'" . $lu->Value . "'";
}
( run in 0.473 second using v1.01-cache-2.11-cpan-88abd93f124 )