- Timestamp:
- 11/03/08 21:15:43 (2 months ago)
- Files:
-
- 1 modified
-
src/perl6/STD_syntax_highlight (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/STD_syntax_highlight
r22847 r22862 214 214 next unless defined $loc[$i]; 215 215 my $c = substr($src_text,$i,1); 216 my $tree = "@{$loc[$i]}"; 217 216 my $tree = ""; 217 for my $action_ref (@{$loc[$i]}) { 218 $tree .= ${$action_ref} . " "; 219 } 218 220 if($tree ne $last_tree) { 219 221 $str .= qq{<span id="tree_$i" style="display:none;">$last_tree</span>}; … … 309 311 next unless defined $loc[$i]; 310 312 my $c = substr($src_text,$i,1); 311 my $tree = "@{$loc[$i]}"; 313 my $tree = ""; 314 for my $action_ref (@{$loc[$i]}) { 315 $tree .= ${$action_ref} . " "; 316 } 312 317 if($tree ne $last_tree) { 313 318 my $rule; … … 380 385 next unless defined $loc[$i]; 381 386 my $c = substr($src_text,$i,1); 382 my $tree = "@{$loc[$i]}"; 387 my $tree = ""; 388 for my $action_ref (@{$loc[$i]}) { 389 $tree .= ${$action_ref} . " "; 390 } 383 391 if($tree ne $last_tree) { 384 392 my $rule; … … 428 436 our $AUTOLOAD; 429 437 438 my %action_refs = (); 439 430 440 sub AUTOLOAD { 431 441 my $self = shift; … … 435 445 $AUTOLOAD =~ s/^Actions:://; 436 446 $loc[$P] = [] if $loc[$P]; # in case we backtracked to here 447 my $action = $AUTOLOAD; 448 my $action_ref = $action_refs{$action}; 449 if(!$action_ref) { 450 $action_refs{$action} = $action_ref = \$action; 451 } 437 452 for ($F..$P-1) { 438 unshift @{$loc[$_]}, $ AUTOLOAD;453 unshift @{$loc[$_]}, $action_ref; 439 454 } 440 455 }
