Changeset 310 for lang/perl/Text-Nyarlax

Show
Ignore:
Timestamp:
09/30/07 16:16:58 (16 months ago)
Author:
nyarla
Message:

lang/perl/Text-Nyarlax: I implemented parse of the Block(Inserted|Deleted) element on Text::Nyarlax::Parser::PRD and changed delimiters of .tb files.

Location:
lang/perl/Text-Nyarlax/trunk
Files:
2 added
30 modified

Legend:

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

    r295 r310  
    104104                        |   BlockQuote 
    105105                        |   BlockNotes 
     106                        |   BlockEdited[ marker => quotemeta('+'), name => 'BlockInserted' ] 
     107                        |   BlockEdited[ marker => quotemeta('-'), name => 'BlockDeleted' ] 
    106108                        |   Paragraph 
    107109 
     
    213215                            my $elm = element( $item[0] ); 
    214216                            $elm->push_content( @{ $item{'Root'} } ); 
     217                            $return = $elm; 
     218                        } 
     219 
     220    BlockEdited         :   /(?:$arg{'marker'}){3}/ Blank Text(?) Blank /\n/ 
     221                                Root 
     222                            /(?:$arg{'marker'}){3}/ Blank DateTime(?) Blank /\n/ 
     223                        { 
     224                            my $elm = element( $arg{'name'} ); 
     225                            $elm->push_content( @{ $item{'Root'} } ); 
     226                            $elm->attr->{'title'} = $item{'Text(?)'}->[0] 
     227                                if ( $item{'Text(?)'}->[0] ); 
     228                            $elm->attr->{'datetime'} = $item{'DateTime(?)'}->[0] 
     229                                if ( $item{'DateTime(?)'}->[0] ); 
    215230                            $return = $elm; 
    216231                        } 
     
    387402    Identifier          :   /[a-zA-Z]+/ 
    388403    URI                 :   /$RE{'URI'}/ 
     404    DateTime            :   /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[\-+]\d{2}:\d{2}/ 
    389405__GRAMMER__ 
    390406 
  • lang/perl/Text-Nyarlax/trunk/t/parser/01_PRD.t

    r88 r310  
    77set_test_elements; 
    88 
     9delimiters('###', '@@@'); 
     10 
    911run_test_parse( in => 'out' ); 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/abbreviation.tb

    r88 r310  
    1 === Abbreviation 
    2 --- in 
     1### Abbreviation 
     2@@@ in 
    33((HTML=Hyper Text Markup Language)) 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/acronym.tb

    r88 r310  
    1 === Acronym 
    2 --- in 
     1### Acronym 
     2@@@ in 
    33((LAN:=Local Area Network)) 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/blocknotes.tb

    r278 r310  
    1 === BlockNotes 
    2 --- in 
     1### BlockNotes 
     2@@@ in 
    33((( 
    44text text text 
    55text text text 
    66))) 
    7 --- out 
     7@@@ out 
    88name: BlockNotes 
    99content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/blockquote.tb

    r260 r310  
    1 === simple BlockQuote 
    2 --- in 
     1### simple BlockQuote 
     2@@@ in 
    33 
    44>>> 
     
    77<<< 
    88 
    9 --- out 
     9@@@ out 
    1010name: BlockQuote 
    1111content: 
     
    1818            text text text 
    1919 
    20 === BlockQuote with Attributes 
    21 --- in 
     20### BlockQuote with Attributes 
     21@@@ in 
    2222 
    2323>>> document title 
     
    2626<<< http://example.com/foo/bar.html 
    2727 
    28 --- out 
     28@@@ out 
    2929name: BlockQuote 
    3030attr: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/citation.tb

    r88 r310  
    1 === Citation 
    2 --- in 
     1### Citation 
     2@@@ in 
    33foo bar >>baz<< 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/code.tb

    r88 r310  
    1 === quote 
    2 --- in 
     1### quote 
     2@@@ in 
    33`$self->parser->parse( $text )` 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/comparison.tb

    r88 r310  
    1 === comparison 
    2 --- in 
     1### comparison 
     2@@@ in 
    33AAABBB//CCC/DDD//EEEFFF 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/definition.tb

    r88 r310  
    1 === Definition 
    2 --- in 
     1### Definition 
     2@@@ in 
    33AAABBB??CCC??DDD 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/deleted.tb

    r88 r310  
    1 === Deleted 
    2 --- in 
     1### Deleted 
     2@@@ in 
    33AAABBB--CCC--DDD 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/embedding.tb

    r88 r310  
    1 === simple Embedding 
    2 --- in 
     1### simple Embedding 
     2@@@ in 
    33{{name}} 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
     
    1212      - "\n" 
    1313 
    14 === Embedding with arguments 
    15 --- in 
     14### Embedding with arguments 
     15@@@ in 
    1616{{name:aaa}} 
    17 --- out 
     17@@@ out 
    1818name: Paragraph 
    1919content: 
     
    2727      - "\n" 
    2828 
    29 === Embedding with Mluti-line 
    30 --- in 
     29### Embedding with Mluti-line 
     30@@@ in 
    3131{{name: 
    3232foo: AAA 
     
    3434baz: CCC 
    3535}} 
    36 --- out 
     36@@@ out 
    3737name: Paragraph 
    3838content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/emphasis.tb

    r88 r310  
    1 === emphasis 
    2 --- in 
     1### emphasis 
     2@@@ in 
    33AAABBBCCC**EEE*FFF** 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/escape.tb

    r88 r310  
    1 === Escape bracket 
    2 --- in 
     1### Escape bracket 
     2@@@ in 
    33AAA BBB CCC \\\(( DDD EEE ))\\\ 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
     
    99      - "AAA BBB CCC (( DDD EEE ))\n" 
    1010 
    11 === Escape one charactor 
    12 --- in 
     11### Escape one charactor 
     12@@@ in 
    1313AAA BBB \"foo bar baz\" 
    14 --- out 
     14@@@ out 
    1515name: Paragraph 
    1616content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/heading.tb

    r89 r310  
    1 === Heading 
    2 --- in 
     1### Heading 
     2@@@ in 
    33= heading = 
    4 --- out 
     4@@@ out 
    55name: Section 
    66content: 
     
    99      - heading 
    1010 
    11 === Heading with ID 
    12 --- in 
     11### Heading with ID 
     12@@@ in 
    1313= heading = MyID 
    14 --- out 
     14@@@ out 
    1515name: Section 
    1616content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/hyperlink.tb

    r88 r310  
    1 === PageLink 
    2 --- in 
     1### PageLink 
     2@@@ in 
    33[[PageName]] 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
     
    1414      - "\n" 
    1515 
    16 === PageLink with title 
     16### PageLink with title 
    1717[[title|PageName]] 
    18 --- out 
     18@@@ out 
    1919name: Paragraph 
    2020content: 
     
    2828      - "\n" 
    2929 
    30 === InterWikiName 
    31 --- in 
     30### InterWikiName 
     31@@@ in 
    3232[[WikiName[PageName]]] 
    33 --- out 
     33@@@ out 
    3434name: Paragraph 
    3535content: 
     
    4444      - "\n" 
    4545 
    46 === InterWikiName with title 
    47 --- in 
     46### InterWikiName with title 
     47@@@ in 
    4848[[title|WikiName[PageName]]] 
    49 --- out 
     49@@@ out 
    5050name: Paragraph 
    5151content: 
     
    6060      - "\n" 
    6161 
    62 === HTTP link 
    63 --- in 
     62### HTTP link 
     63@@@ in 
    6464[[http://example.com/foo/bar/]] 
    65 --- out 
     65@@@ out 
    6666name: Paragraph 
    6767content: 
     
    7575      - "\n" 
    7676 
    77 === HTTP link with title 
    78 --- in 
     77### HTTP link with title 
     78@@@ in 
    7979[[title|http://example.com/foo/bar/]] 
    80 --- out 
     80@@@ out 
    8181name: Paragraph 
    8282content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/inputcommand.tb

    r88 r310  
    1 === InputCommand 
    2 --- in 
     1### InputCommand 
     2@@@ in 
    33[$prove -I lib t/*.t$] 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/inputtext.tb

    r88 r310  
    1 === InputText 
    2 --- in 
     1### InputText 
     2@@@ in 
    33AAABBB[|CCC|]DDD 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/inserted.tb

    r88 r310  
    1 === Inserted 
    2 --- in 
     1### Inserted 
     2@@@ in 
    33AAABBB++CCC++DDD 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/keyboard.tb

    r88 r310  
    1 === Keyboard 
    2 --- in 
     1### Keyboard 
     2@@@ in 
    33<[shift]> + <[c]> 
    4 --- out 
     4@@@ out 
    55name: Paragraph 
    66content: 
  • lang/perl/Text-Nyarlax/trunk/t/parser/spec/list.tb

    <
    r251 r310  
    1 === simple List 
    2 --- in 
    3  
    4 * item 
    5 * item 
    6 * item 
    7  
    8 --- out 
     1### simple List 
     2@@@ in 
     3 
     4* item 
     5* item 
     6* item 
     7 
     8@@@ out 
    99name: UnorderedList 
    1010content: 
     
    1919      - item 
    2020 
    21 === multi-line list 
    22 --- in 
     21### multi-line list 
     22@@@ in 
    2323 
    2424# text text text 
     
    2929  text text text 
    3030 
    31 --- out 
     31@@@ out 
    3232name: OrderedList 
    3333content: 
     
    4848        text text text 
    4949 
    50 === inline-block List 
    51 --- in 
     50### inline-block List 
     51@@@ in 
    5252 
    5353* >> 
     
    6161* item 
    6262 
    63 --- out 
     63@@@ out 
    6464name: UnorderedList 
    6565content: 
     
    8585      - item 
    8686 
    87 === simple DefinitionList 
    88 --- in 
     87### simple DefinitionList 
     88@@@ in 
    8989 
    9090? term 
     
    9696 
    9797 
    98 --- out 
     98@@@ out 
    9999name: DefinitionList 
    100100content: 
     
    123123 
    124124 
    125 === multi-line DefinitionDescription 
    126 --- in 
     125### multi-line DefinitionDescription 
     126@@@ in 
    127127 
    128128? text text text 
     
    132132 
    133133 
    134 --- out 
     134@@@ out 
    135135name: DefinitionList 
    136136content: 
     
    148148            text text text 
    149149 
    150 === inline-block DefinitionList 
    151 --- in 
     150### inline-block DefinitionList 
     151@@@ in 
    152152 
    153153? term 
     
    158158: description 
    159159 
    160 --- out 
     160@@@ out 
    161161name: DefinitionList 
    162162content: 
     
    179179          - description 
    180180 
    181 === simple nestring list 
    182 --- in 
     181### simple nestring list 
     182@@@ in 
    183183 
    184184* item 
     
    187187    : description 
    188188 
    189 --- out 
     189@@@ out 
    190190name: UnorderedList 
    191191content: 
     
    209209                          - description 
    210210 
    211 === multi-line nesting list 
    212 --- in 
     211### multi-line nesting list 
     212@@@ in 
    213213 
    214214# text text text 
     
    221221      text text text 
    222222 
    223 --- out 
     223@@@ out 
    224224name: OrderedList 
    225225content: 
     
    251251                            text text text 
    252252 
    253 === inline-block nesting list 
    254 --- in 
     253### inline-block nesting list