Changeset 22840 for src

Show
Ignore:
Timestamp:
10/31/08 18:50:45 (2 months ago)
Author:
azawawi
Message:

[STD_syntax_highlight] changed the redspans* to simple*

Location:
src/perl6
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/ETOOMUCHTIME

    r22837 r22840  
    4242    my $myfile = $file; 
    4343    $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"); 
    4545    my ($html_filename,$html_path,$html_suffix) = fileparse($full_html); 
    4646    mkpath $html_path; 
     
    5151$file 
    5252    -> $full_html 
    53     -> $redspans_html 
     53    -> $simple_html 
    5454OUT 
    5555    my $t0 = new Benchmark; 
    5656    my $cmd = "./$HILITE --clean-html " . 
    57             "--redspans-html=$redspans_html " . 
     57            "--redspans-html=$simple_html " . 
    5858            "--full-html=$full_html $file"; 
    5959    my $log = `$cmd 2>&1`; 
     
    8484</pre></body></html> 
    8585ERROR 
    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; 
    9090        open FULL_HTML, ">$full_html" 
    9191            or die "Could not open $full_html for writing: $OS_ERROR\n"; 
  • src/perl6/STD_syntax_highlight

    r22839 r22840  
    3030    STD_syntax_highlight foo.pl statementlist 
    3131 
    32     # write redspans output to foo.redspans.html 
    33     STD_syntax_highlight --redspans-html=foo.redspans.html foo.pl 
     32    # write simple output to foo.pl.html 
     33    STD_syntax_highlight --simple-html=foo.pl.html foo.pl 
    3434 
    3535=head1 SUBROUTINES 
     
    4040 
    4141my ($clean_html,$help) = (0,0); 
    42 my ($full_html,$redspans_html) = (0,'-'); 
     42my ($full_html,$simple_html) = (0,'-'); 
    4343my ($file, $parser, $src_text);  
    4444 
     
    5656        "clean-html"=>\$clean_html, 
    5757        "full-html=s"=>\$full_html, 
    58         "redspans-html=s"=>\$redspans_html, 
     58        "simple-html=s"=>\$simple_html, 
    5959        "help"=>\$help 
    6060    ); 
     
    7373        write full-mode html to filename (disabled by default, - for STDOUT) 
    7474 
    75     --redspans-html=filename    
    76         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) 
    7777 
    7878HELP 
     
    124124        write_html_file $full_html, $html; 
    125125    } 
    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; 
    129129    } 
    130130} 
     
    243243} 
    244244 
    245 =item highlight_perl6_redspans 
    246  
    247 This is same as C<highlight_perl6_full> when --redspans is used. 
     245=item highlight_perl6_simple 
     246 
     247This is same as C<highlight_perl6_full> when --simple-html is used. 
    248248No more javascript tree viewer or anything fancy.  
    249249Only nodes that have a color are printed. Not optimal but works ;-) 
    250250=cut 
    251 sub highlight_perl6_redspans { 
     251sub highlight_perl6_simple { 
    252252    my $str = ""; 
    253253    my %colors = ();