Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Util/203450 to your computer and use it in GitHub Desktop.
Save Util/203450 to your computer and use it in GitHub Desktop.
Index: std_hilite/STD_syntax_highlight
===================================================================
--- std_hilite/STD_syntax_highlight (revision 28640)
+++ std_hilite/STD_syntax_highlight (working copy)
@@ -447,6 +447,14 @@
my ($last_tree,$buffer, $last_type) = ("","","");
for my $i (0 .. @loc-1) {
next unless defined $loc[$i];
+
+ # XXX Bug? @loc is too long for $src_text.
+ # Extra @loc[-2,-1] are 'vws' and 'eat_terminator'.
+ if ( $i >= length $src_text ) {
+ #warn "\$i was $i, which is past the end of \$src_text\n";
+ next;
+ }
+
my $c = substr($src_text,$i,1);
my $tree = "";
for my $action_ref (@{$loc[$i]}) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment