Changeset 21785 for src/perl6

Show
Ignore:
Timestamp:
08/04/08 19:14:25 (4 months ago)
Author:
lwall
Message:

[STD5_dump_match] use new parsefile method

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/STD5_dump_match

    r21735 r21785  
    1515GetOptions("nocolor"=>\$nocolor,"horizontal"=>\$horizontal,"yaml"=>\$yaml,"mark-arrays"=>\$mark_arrays); 
    1616unless ($#ARGV <= 0) { 
    17     die "USAGE: [--nocolor --horizontal --mark-arrays] [filename]\n"; 
     17    die "USAGE: [--nocolor --horizontal --mark-arrays] filename [rule]\n"; 
    1818} 
    1919if ($nocolor) { 
    2020    $DumpMatch::NOCOLOR = 1; 
    2121} 
     22my $file = shift; 
     23my $what = shift // 'comp_unit'; 
    2224 
    23 my $what = 'comp_unit'; 
    24 my $text; 
    25 { 
    26 local $/; 
    27 $text = Encode::decode('utf8', scalar <>); 
    28 } 
    29  
    30 my $r = STD->new($text)->$what(); 
     25my $r = STD->parsefile($file,$what); 
    3126if ($yaml) { 
    3227    print Dump($r);