Changeset 23023 for src

Show
Ignore:
Timestamp:
11/15/08 13:43:33 (8 weeks ago)
Author:
azawawi
Message:

[STD_syntax_highlight] highlight scalar, array and hash variables

Location:
src/perl6
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/STD_syntax_highlight

    r23020 r23023  
    55use warnings; 
    66use utf8; 
    7 use feature qw(say); 
     7use feature qw(say switch); 
    88use English; 
    99use Getopt::Long; 
     
    445445    my ($process_buffer,%colors) = @ARG; 
    446446 
    447     my ($last_tree,$buffer) = ("",""); 
     447    my ($last_tree,$buffer, $last_type) = ("","",""); 
    448448    for my $i (0 .. @loc-1) { 
    449449        next unless defined $loc[$i]; 
     
    474474                    } elsif($parser->is_routine($buffer)) { 
    475475                        $rule_to_color = '_routine'; 
    476                     }  
    477                 }               
     476                    } elsif($last_type ne '') { 
     477                        $rule_to_color = $last_type; 
     478                        $last_type = ''; 
     479                    } 
     480                } elsif($last_tree =~ /sigil/) { 
     481                    given($buffer) { 
     482                        when ('$') { $last_type = '_scalar'; } 
     483                        when ('@') { $last_type = '_array'; } 
     484                        when ('%') { $last_type = '_hash'; } 
     485                        default { $last_type = ''; } 
     486                    }       
     487                    $rule_to_color = $last_type if $last_type ne '';  
     488                }              
    478489            } 
    479490            #now delegate printing to a callback 
  • src/perl6/STD_syntax_highlight.ansi

    r22879 r23023  
    1919_routine=bold red 
    2020_type=bold blue 
     21_scalar=bold blue 
     22_array=bold magenta 
     23_hash=bold yellow 
    2124_comment=bold green 
  • src/perl6/STD_syntax_highlight.css

    r22879 r23023  
    1919._routine { color: DarkRed; font-weight: bold; } 
    2020._type { color: DarkBlue; font-weight: bold; } 
     21._scalar { color: DarkBlue; font-weight: bold; } 
     22._array { color: Brown; font-weight: bold; } 
     23._hash { color: DarkOrange; font-weight: bold; } 
    2124._comment { color: DarkGreen; font-weight: bold; } 
    2225