Skip to content

Commit

Permalink
RakuAST: workaround for substr error when reporting parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Mar 5, 2023
1 parent e3e250c commit a620d0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Raku/Grammar.nqp
Expand Up @@ -371,6 +371,7 @@ role Raku::Common {

my $prestart := $pos - 40;
$prestart := 0 if $prestart < 0;
$pos := 0 if $pos < 0; #FIXME workaround for when $pos is -3. Need to figure out how to get the real pos
my $pre := nqp::substr($orig, $prestart, $pos - $prestart);
$pre := subst($pre, /.*\n/, "", :global);
$pre := '<BOL>' if $pre eq '';
Expand Down

0 comments on commit a620d0f

Please sign in to comment.