- Timestamp:
- 11/15/08 13:43:33 (8 weeks ago)
- Location:
- src/perl6
- Files:
-
- 3 modified
-
STD_syntax_highlight (modified) (3 diffs)
-
STD_syntax_highlight.ansi (modified) (1 diff)
-
STD_syntax_highlight.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/STD_syntax_highlight
r23020 r23023 5 5 use warnings; 6 6 use utf8; 7 use feature qw(say );7 use feature qw(say switch); 8 8 use English; 9 9 use Getopt::Long; … … 445 445 my ($process_buffer,%colors) = @ARG; 446 446 447 my ($last_tree,$buffer ) = ("","");447 my ($last_tree,$buffer, $last_type) = ("","",""); 448 448 for my $i (0 .. @loc-1) { 449 449 next unless defined $loc[$i]; … … 474 474 } elsif($parser->is_routine($buffer)) { 475 475 $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 } 478 489 } 479 490 #now delegate printing to a callback -
src/perl6/STD_syntax_highlight.ansi
r22879 r23023 19 19 _routine=bold red 20 20 _type=bold blue 21 _scalar=bold blue 22 _array=bold magenta 23 _hash=bold yellow 21 24 _comment=bold green -
src/perl6/STD_syntax_highlight.css
r22879 r23023 19 19 ._routine { color: DarkRed; font-weight: bold; } 20 20 ._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; } 21 24 ._comment { color: DarkGreen; font-weight: bold; } 22 25
