Show
Ignore:
Timestamp:
07/03/08 22:05:08 (5 months ago)
Author:
pmurias
Message:

[sm0p] initial version of the new grammar

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • misc/sm0p/strip_out_actions

    r20904 r21193  
    2727    my $body = $3; 
    2828    my $end = $4; 
    29     $body =~ s/(?<!')\{ ($block) \}/push(@blocks,["${name}__sm0p_$nr",$1]);'{*}' . "  #= sm0p_" . $nr++/egx; 
     29    $body =~ s/(?<!')\{ ($block) \}/push(@blocks,["${name}__sm0p_$nr",$1]);'{*}' . "  #= sm0p_" . $nr++ . "\n" 
     30/egx; 
    3031    $start.$body.$end; 
    3132]exg; 
     
    4344} 
    4445sub adapter { 
    45     local $_; 
    4646    if (ref $_[0] eq 'ARRAY') { 
    4747        [map {$_->item} @{$_[0]}]; 
     48    } elsif ($_[0]) { 
     49        $_[0]->item; 
    4850    } else { 
    49         $_[0]->item; 
     51        $_[0] 
    5052    } 
    5153}