- Timestamp:
- 10/31/08 18:50:45 (2 months ago)
- Location:
- src/perl6
- Files:
-
- 2 modified
-
ETOOMUCHTIME (modified) (3 diffs)
-
STD_syntax_highlight (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/ETOOMUCHTIME
r22837 r22840 42 42 my $myfile = $file; 43 43 $myfile =~ s/^\.\.\/\.\.\/t\/spec/html/; 44 my ($ redspans_html,$full_html) = ("$myfile.simple.html", "$myfile.html");44 my ($simple_html,$full_html) = ("$myfile.simple.html", "$myfile.html"); 45 45 my ($html_filename,$html_path,$html_suffix) = fileparse($full_html); 46 46 mkpath $html_path; … … 51 51 $file 52 52 -> $full_html 53 -> $ redspans_html53 -> $simple_html 54 54 OUT 55 55 my $t0 = new Benchmark; 56 56 my $cmd = "./$HILITE --clean-html " . 57 "--redspans-html=$ redspans_html " .57 "--redspans-html=$simple_html " . 58 58 "--full-html=$full_html $file"; 59 59 my $log = `$cmd 2>&1`; … … 84 84 </pre></body></html> 85 85 ERROR 86 open REDSPANS_HTML, ">$redspans_html"87 or die "Could not open $ redspans_html for writing: $OS_ERROR\n";88 print REDSPANS_HTML $error_html;89 close REDSPANS_HTML;86 open SIMPLE_HTML, ">$simple_html" 87 or die "Could not open $simple_html for writing: $OS_ERROR\n"; 88 print SIMPLE_HTML $error_html; 89 close SIMPLE_HTML; 90 90 open FULL_HTML, ">$full_html" 91 91 or die "Could not open $full_html for writing: $OS_ERROR\n"; -
src/perl6/STD_syntax_highlight
r22839 r22840 30 30 STD_syntax_highlight foo.pl statementlist 31 31 32 # write redspans output to foo.redspans.html33 STD_syntax_highlight -- redspans-html=foo.redspans.html foo.pl32 # write simple output to foo.pl.html 33 STD_syntax_highlight --simple-html=foo.pl.html foo.pl 34 34 35 35 =head1 SUBROUTINES … … 40 40 41 41 my ($clean_html,$help) = (0,0); 42 my ($full_html,$ redspans_html) = (0,'-');42 my ($full_html,$simple_html) = (0,'-'); 43 43 my ($file, $parser, $src_text); 44 44 … … 56 56 "clean-html"=>\$clean_html, 57 57 "full-html=s"=>\$full_html, 58 " redspans-html=s"=>\$redspans_html,58 "simple-html=s"=>\$simple_html, 59 59 "help"=>\$help 60 60 ); … … 73 73 write full-mode html to filename (disabled by default, - for STDOUT) 74 74 75 -- redspans-html=filename76 write redspans-mode html to filename (enabled by default, - for STDOUT)75 --simple-html=filename 76 write simple-mode html to filename (enabled by default, - for STDOUT) 77 77 78 78 HELP … … 124 124 write_html_file $full_html, $html; 125 125 } 126 if($ redspans_html) {127 my $html = highlight_perl6_ redspans();128 write_html_file $ redspans_html, $html;126 if($simple_html) { 127 my $html = highlight_perl6_simple(); 128 write_html_file $simple_html, $html; 129 129 } 130 130 } … … 243 243 } 244 244 245 =item highlight_perl6_ redspans246 247 This is same as C<highlight_perl6_full> when -- redspansis used.245 =item highlight_perl6_simple 246 247 This is same as C<highlight_perl6_full> when --simple-html is used. 248 248 No more javascript tree viewer or anything fancy. 249 249 Only nodes that have a color are printed. Not optimal but works ;-) 250 250 =cut 251 sub highlight_perl6_ redspans{251 sub highlight_perl6_simple { 252 252 my $str = ""; 253 253 my %colors = ();
