- Timestamp:
- 10/29/08 21:29:15 (2 months ago)
- Files:
-
- 1 modified
-
src/perl6/STD_syntax_highlight (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/STD_syntax_highlight
r22820 r22821 31 31 32 32 # write only simple html/css to simple.html 33 STD_syntax_highlight --simple-html=simple.html foo.pl 33 STD_syntax_highlight --simple-html=foo.simple.html foo.pl 34 35 # write redspans output to foo.redspans.html 36 STD_syntax_highlight --redspans-html=foo.redspans.html foo.pl 34 37 =head1 SUBROUTINES 35 38 … … 40 43 #process the command line 41 44 my ($clean_html,$help) = (0,0); 42 my ($simple_html,$full_html ) = (0,'-');45 my ($simple_html,$full_html,$redspans_html) = (0,'-',0); 43 46 GetOptions( 44 47 "clean-html"=>\$clean_html, 45 48 "simple-html=s"=>\$simple_html, 46 49 "full-html=s"=>\$full_html, 50 "redspans-html=s"=>\$redspans_html, 47 51 "help"=>\$help 48 52 ); … … 59 63 60 64 --simple-html=filename 61 simple mode outputfilename (disabled by default, - for STDOUT)65 write simple-mode html to filename (disabled by default, - for STDOUT) 62 66 63 67 --full-html=filename 64 full mode output filename (enabled by default, - for STDOUT) 68 write full-mode html to filename (enabled by default, - for STDOUT) 69 70 --redspans-html=filename 71 write redspans-mode html to filename (enabled by default, - for STDOUT) 65 72 66 73 HELP … … 107 114 open FILE, ">$full_html" or 108 115 die "Cannot open $full_html for writing: $OS_ERROR\n"; 116 print FILE $output; 117 close FILE; 118 } 119 } 120 if($redspans_html) { 121 my $output = highlight_perl6_redspans(); 122 if($redspans_html eq '-') { 123 print $output; 124 } else { 125 open FILE, ">$redspans_html" or 126 die "Cannot open $redspans_html for writing: $OS_ERROR\n"; 109 127 print FILE $output; 110 128 close FILE; … … 302 320 } 303 321 322 =item highlight_perl6_redspans 323 324 This is same as C<highlight_perl> when --redspans is used. 325 No more javascript tree viewer or anything fancy. 326 Only nodes that have a color are printed. Not optimal but works ;-) 327 =cut 328 sub highlight_perl6_redspans { 329 # my ($orig,$events,$opt) = @_; 330 } 331 304 332 =item escape_html 305 333 … … 330 358 The initial STD tree traversal code was written by Paweł Murias (pmurias). 331 359 360 The redspans traversal code was written by Larry Wall (TimToady). 361 332 362 The browser code was written by Ahmad M. Zawawi (azawawi) 333 363 =cut
