Changeset 295 for lang/perl/Text-Nyarlax

Show
Ignore:
Timestamp:
09/28/07 13:39:45 (16 months ago)
Author:
nyarla
Message:

lang/perl/Text-Nyarlax: I deleted grammatical waste about rule Content.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Text-Nyarlax/trunk/lib/Text/Nyarlax/Parser/PRD.pm

    r278 r295  
    8888                            <rulevar: local $h_level    = 1                                         > 
    8989 
    90     parse               :   <skip: ''> /\n*/ Content(s) 
     90    parse               :   <skip: ''> Root 
     91                        { $return = $item{'Root'} } 
     92 
     93    Root                :   /\n*/ Content(s) 
    9194                        { 
    9295                            my $tree = $item{'Content(s)'}; 
     
    103106                        |   Paragraph 
    104107 
    105     Section             :   Heading Content(s?) 
     108    Section             :   Heading Root(?) 
    106109                        { 
    107110                            $h_level--; 
    108111                            my $elm = element( $item[0] ); 
    109                             $elm->push_content( $item{'Heading'}, @{ $item{'Content(s?)'} } ); 
    110                             $elm->join_content( element => 'Section' ); 
     112                            $elm->push_content( $item{'Heading'}, @{ flatten($item{'Root(?)'}) } ); 
    111113                            $return = $elm; 
    112114                        } 
     
    197199 
    198200    BlockQuote          :   />>>/ Blank Text(?) Blank /\n/ 
    199                                 Content(s) 
     201                                Root 
    200202                            /<<</ Blank URI(?) Blank /\n/ 
    201203                        { 
    202204                            my $elm = element( $item[0] ); 
    203                             $elm->push_content( @{ $item{'Content(s)'} } ); 
    204                             $elm->join_content( element => 'Section' ); 
     205                            $elm->push_content( @{ $item{'Root'} } ); 
    205206                            $elm->attr->{'title'} = $item{'Text(?)'}->[0] if ( $item{'Text(?)'}->[0] ); 
    206207                            $elm->attr->{'cite'}  = $item{'URI(?)'}->[0]  if ( $item{'URI(?)'}->[0] ); 
     
    208209                        } 
    209210 
    210     BlockNotes          :   /[(]{3}\n/ Content(s) /[)]{3}\n/ 
    211                         { 
    212                             my $elm = element( $item[0] ); 
    213                             $elm->push_content( @{ $item{'Content(s)'} } ); 
    214                             $elm->join_content( element => 'Section' ); 
     211    BlockNotes          :   /[(]{3}\n/ Root /[)]{3}\n/ 
     212                        { 
     213                            my $elm = element( $item[0] ); 
     214                            $elm->push_content( @{ $item{'Root'} } ); 
    215215                            $return = $elm; 
    216216                        }