CSS

 view release on metacpan or  search on metacpan

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

                      Parse::RecDescent::_tracemax(substr($_[1],0,-length($text))) . q{])}, 
                      Parse::RecDescent::_tracefirst($text),
                      , q{_alternation_1_of_production_1_of_rule_macro_string1},
                      $tracelevel)
    }
    $_[1] = $text;
    return $return;
}

# ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args)
sub Parse::RecDescent::CSS::Parse::CompiledGrammar::macro_unicode
{
	my $thisparser = $_[0];
	use vars q{$tracelevel};
	local $tracelevel = ($tracelevel||0)+1;
	$ERRORS = 0;
    my $thisrule = $thisparser->{"rules"}{"macro_unicode"};
    
    Parse::RecDescent::_trace(q{Trying rule: [macro_unicode]},
                  Parse::RecDescent::_tracefirst($_[1]),
                  q{macro_unicode},
                  $tracelevel)
                    if defined $::RD_TRACE;

    
    my $err_at = @{$thisparser->{errors}};

    my $score;
    my $score_return;
    my $_tok;
    my $return = undef;

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

    my $thisline;
    tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser;

    

    while (!$_matched && !$commit)
    {
        
        Parse::RecDescent::_trace(q{Trying production: [/\\[0-9a-f]\{1,6\}[ \\n\\r\\t\\f]?/]},
                      Parse::RecDescent::_tracefirst($_[1]),
                      q{macro_unicode},
                      $tracelevel)
                        if defined $::RD_TRACE;
        my $thisprod = $thisrule->{"prods"}[0];
        $text = $_[1];
        my $_savetext;
        @item = (q{macro_unicode});
        %item = (__RULE__ => q{macro_unicode});
        my $repcount = 0;


        Parse::RecDescent::_trace(q{Trying terminal: [/\\[0-9a-f]\{1,6\}[ \\n\\r\\t\\f]?/]}, Parse::RecDescent::_tracefirst($text),
                      q{macro_unicode},
                      $tracelevel)
                        if defined $::RD_TRACE;
        $lastsep = "";
        $expectation->is(q{})->at($text);
        

        unless ($text =~ s/\A($skip)/$lastsep=$1 and ""/e and   $text =~ m/\A(?:\[0-9a-f]{1,6}[ \n\r\t\f]?)/)
        {
            
            $expectation->failed();

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

        substr($text,0,length($current_match),q{});
        Parse::RecDescent::_trace(q{>>Matched terminal<< (return value: [}
                        . $current_match . q{])},
                          Parse::RecDescent::_tracefirst($text))
                    if defined $::RD_TRACE;
        push @item, $item{__PATTERN1__}=$current_match;
        

        Parse::RecDescent::_trace(q{Trying action},
                      Parse::RecDescent::_tracefirst($text),
                      q{macro_unicode},
                      $tracelevel)
                        if defined $::RD_TRACE;
        

        $_tok = ($_noactions) ? 0 : do {$return = $item[1]};
        unless (defined $_tok)
        {
            Parse::RecDescent::_trace(q{<<Didn't match action>> (return value: [undef])})
                    if defined $::RD_TRACE;
            last;

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

                      . $_tok . q{])},
                      Parse::RecDescent::_tracefirst($text))
                        if defined $::RD_TRACE;
        push @item, $_tok;
        $item{__ACTION1__}=$_tok;
        


        Parse::RecDescent::_trace(q{>>Matched production: [/\\[0-9a-f]\{1,6\}[ \\n\\r\\t\\f]?/]<<},
                      Parse::RecDescent::_tracefirst($text),
                      q{macro_unicode},
                      $tracelevel)
                        if defined $::RD_TRACE;
        $_matched = 1;
        last;
    }


    unless ( $_matched || defined($score) )
    {
        

        $_[1] = $text;  # NOT SURE THIS IS NEEDED
        Parse::RecDescent::_trace(q{<<Didn't match rule>>},
                     Parse::RecDescent::_tracefirst($_[1]),
                     q{macro_unicode},
                     $tracelevel)
                    if defined $::RD_TRACE;
        return undef;
    }
    if (!defined($return) && defined($score))
    {
        Parse::RecDescent::_trace(q{>>Accepted scored production<<}, "",
                      q{macro_unicode},
                      $tracelevel)
                        if defined $::RD_TRACE;
        $return = $score_return;
    }
    splice @{$thisparser->{errors}}, $err_at;
    $return = $item[$#item] unless defined $return;
    if (defined $::RD_TRACE)
    {
        Parse::RecDescent::_trace(q{>>Matched rule<< (return value: [} .
                      $return . q{])}, "",
                      q{macro_unicode},
                      $tracelevel);
        Parse::RecDescent::_trace(q{(consumed: [} .
                      Parse::RecDescent::_tracemax(substr($_[1],0,-length($text))) . q{])}, 
                      Parse::RecDescent::_tracefirst($text),
                      , q{macro_unicode},
                      $tracelevel)
    }
    $_[1] = $text;
    return $return;
}

# ARGS ARE: ($parser, $text; $repeating, $_noactions, \@args)
sub Parse::RecDescent::CSS::Parse::CompiledGrammar::_alternation_1_of_production_2_of_rule_URI
{
	my $thisparser = $_[0];

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

    my $commit=0;
    my @item = ();
    my %item = ();
    my $repeating =  defined($_[2]) && $_[2];
    my $_noactions = defined($_[3]) && $_[3];
    my @arg =    defined $_[4] ? @{ &{$_[4]} } : ();
    my %arg =    ($#arg & 01) ? @arg : (@arg, undef);
    my $text;
    my $lastsep="";
    my $current_match;
    my $expectation = new Parse::RecDescent::Expectation(q{macro_unicode, or /\\\\[ -~\\200-\\4177777]/});
    $expectation->at($_[1]);
    
    my $thisline;
    tie $thisline, q{Parse::RecDescent::LineCounter}, \$text, $thisparser;

    

    while (!$_matched && !$commit)
    {
        
        Parse::RecDescent::_trace(q{Trying production: [macro_unicode]},
                      Parse::RecDescent::_tracefirst($_[1]),
                      q{macro_escape},
                      $tracelevel)
                        if defined $::RD_TRACE;
        my $thisprod = $thisrule->{"prods"}[0];
        $text = $_[1];
        my $_savetext;
        @item = (q{macro_escape});
        %item = (__RULE__ => q{macro_escape});
        my $repcount = 0;


        Parse::RecDescent::_trace(q{Trying subrule: [macro_unicode]},
                  Parse::RecDescent::_tracefirst($text),
                  q{macro_escape},
                  $tracelevel)
                    if defined $::RD_TRACE;
        if (1) { no strict qw{refs};
        $expectation->is(q{})->at($text);
        unless (defined ($_tok = Parse::RecDescent::CSS::Parse::CompiledGrammar::macro_unicode($thisparser,$text,$repeating,$_noactions,sub { \@arg })))
        {
            
            Parse::RecDescent::_trace(q{<<Didn't match subrule: [macro_unicode]>>},
                          Parse::RecDescent::_tracefirst($text),
                          q{macro_escape},
                          $tracelevel)
                            if defined $::RD_TRACE;
            $expectation->failed();
            last;
        }
        Parse::RecDescent::_trace(q{>>Matched subrule: [macro_unicode]<< (return value: [}
                    . $_tok . q{]},
                      
                      Parse::RecDescent::_tracefirst($text),
                      q{macro_escape},
                      $tracelevel)
                        if defined $::RD_TRACE;
        $item{q{macro_unicode}} = $_tok;
        push @item, $_tok;
        
        }

        Parse::RecDescent::_trace(q{Trying action},
                      Parse::RecDescent::_tracefirst($text),
                      q{macro_escape},
                      $tracelevel)
                        if defined $::RD_TRACE;
        

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

        }
        Parse::RecDescent::_trace(q{>>Matched action<< (return value: [}
                      . $_tok . q{])},
                      Parse::RecDescent::_tracefirst($text))
                        if defined $::RD_TRACE;
        push @item, $_tok;
        $item{__ACTION1__}=$_tok;
        


        Parse::RecDescent::_trace(q{>>Matched production: [macro_unicode]<<},
                      Parse::RecDescent::_tracefirst($text),
                      q{macro_escape},
                      $tracelevel)
                        if defined $::RD_TRACE;
        $_matched = 1;
        last;
    }


    while (!$_matched && !$commit)

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

                                                                                                                                             'code' => '{$return = $item[1]}'
                                                                                                                                           }, 'Parse::RecDescent::Action' )
                                                                                                                                  ],
                                                                                                                       'line' => 114
                                                                                                                     }, 'Parse::RecDescent::Production' )
                                                                                                            ],
                                                                                                 'name' => '_alternation_1_of_production_1_of_rule_macro_string1',
                                                                                                 'vars' => '',
                                                                                                 'line' => 109
                                                                                               }, 'Parse::RecDescent::Rule' ),
                              'macro_unicode' => bless( {
                                                          'impcount' => 0,
                                                          'calls' => [],
                                                          'changed' => 0,
                                                          'opcount' => 0,
                                                          'prods' => [
                                                                       bless( {
                                                                                'number' => '0',
                                                                                'strcount' => 0,
                                                                                'dircount' => 0,
                                                                                'uncommit' => undef,

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

                                                                                             bless( {
                                                                                                      'hashname' => '__ACTION1__',
                                                                                                      'lookahead' => 0,
                                                                                                      'line' => 89,
                                                                                                      'code' => '{$return = $item[1]}'
                                                                                                    }, 'Parse::RecDescent::Action' )
                                                                                           ],
                                                                                'line' => undef
                                                                              }, 'Parse::RecDescent::Production' )
                                                                     ],
                                                          'name' => 'macro_unicode',
                                                          'vars' => '',
                                                          'line' => 89
                                                        }, 'Parse::RecDescent::Rule' ),
                              '_alternation_1_of_production_2_of_rule_URI' => bless( {
                                                                                       'impcount' => 0,
                                                                                       'calls' => [
                                                                                                    'macro_nonascii',
                                                                                                    'macro_escape'
                                                                                                  ],
                                                                                       'changed' => 0,

CSS/Parse/CompiledGrammar.pm  view on Meta::CPAN

                                                                            }, 'Parse::RecDescent::Production' )
                                                                   ],
                                                        'name' => 'declaration',
                                                        'vars' => ' local $value;
',
                                                        'line' => 25
                                                      }, 'Parse::RecDescent::Rule' ),
                              'macro_escape' => bless( {
                                                         'impcount' => 0,
                                                         'calls' => [
                                                                      'macro_unicode'
                                                                    ],
                                                         'changed' => 0,
                                                         'opcount' => 0,
                                                         'prods' => [
                                                                      bless( {
                                                                               'number' => '0',
                                                                               'strcount' => 0,
                                                                               'dircount' => 0,
                                                                               'uncommit' => undef,
                                                                               'error' => undef,
                                                                               'patcount' => 0,
                                                                               'actcount' => 1,
                                                                               'items' => [
                                                                                            bless( {
                                                                                                     'subrule' => 'macro_unicode',
                                                                                                     'matchrule' => 0,
                                                                                                     'implicit' => undef,
                                                                                                     'argcode' => undef,
                                                                                                     'lookahead' => 0,
                                                                                                     'line' => 90
                                                                                                   }, 'Parse::RecDescent::Subrule' ),
                                                                                            bless( {
                                                                                                     'hashname' => '__ACTION1__',
                                                                                                     'lookahead' => 0,
                                                                                                     'line' => 90,

CSS/Parse/PRDGrammar.pm  view on Meta::CPAN


  ##
  ## MACROS
  ##
  macro_ident:		macro_nmstart macro_nmchar(s?)		{$return = $item[1]; if (scalar(@{$item[2]}) > 0){$return .= join('',@{$item[2]});} 1;}
  macro_name:		macro_nmchar(s)				{$return = join('',@{$item[1]})}
  macro_nmstart:	/[a-zA-Z]/				{$return = $item[1]}
			| macro_nonascii			{$return = $item[1]}
			| macro_escape				{$return = $item[1]}
  macro_nonascii:	/[^\\0-\\177]/				{$return = $item[1]}
  macro_unicode:	/\\[0-9a-f]{1,6}[ \\n\\r\\t\\f]?/	{$return = $item[1]}
  macro_escape:		macro_unicode				{$return = $item[1]}
			| /\\\\[ -~\\200-\\4177777]/		{$return = $item[1]}
  macro_nmchar:		/[a-z0-9-]/				{$return = $item[1]}
			| macro_nonascii			{$return = $item[1]}
			| macro_escape				{$return = $item[1]}
  macro_num:		/[0-9]+|[0-9]*\\.[0-9]+/		{$return = $item[1]}
  macro_string:		macro_string1 				{$return = $item[1]}
			| macro_string2				{$return = $item[1]}
  macro_string1:	'"' ( 
				/[\\t \!#$%&(-~]/ 		{$return = $item[1]}
				| '\\\\' macro_nl 		{$return = ''}



( run in 0.620 second using v1.01-cache-2.11-cpan-88abd93f124 )