- Timestamp:
- 08/04/08 19:14:25 (4 months ago)
- Files:
-
- 1 modified
-
src/perl6/STD5_dump_match (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/STD5_dump_match
r21735 r21785 15 15 GetOptions("nocolor"=>\$nocolor,"horizontal"=>\$horizontal,"yaml"=>\$yaml,"mark-arrays"=>\$mark_arrays); 16 16 unless ($#ARGV <= 0) { 17 die "USAGE: [--nocolor --horizontal --mark-arrays] [filename]\n";17 die "USAGE: [--nocolor --horizontal --mark-arrays] filename [rule]\n"; 18 18 } 19 19 if ($nocolor) { 20 20 $DumpMatch::NOCOLOR = 1; 21 21 } 22 my $file = shift; 23 my $what = shift // 'comp_unit'; 22 24 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(); 25 my $r = STD->parsefile($file,$what); 31 26 if ($yaml) { 32 27 print Dump($r);
