Skip to content

Commit

Permalink
Make sure Grammar.parse can handle Cool again
Browse files Browse the repository at this point in the history
f10e5bc started using nqp::chars, which breaks if
the thing to parse is a non-Str Cool (such as an Int).  Fixed by
calling .chars instead.  Fixes Grammar::HTTP and Template::Mustache.
  • Loading branch information
lizmat committed Jun 17, 2020
1 parent afe8511 commit 1402c1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.c/Grammar.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ my class Grammar is Match {
$grammar."$rule"()
)),
nqp::stmts(
(my int $chars = nqp::chars($orig)),
(my int $chars = $orig.chars), # must be HLL, $orig can be Cool
nqp::while(
$cursor
&& nqp::isne_i(nqp::getattr_i($cursor,Match,'$!pos'),$chars),
Expand Down

0 comments on commit 1402c1d

Please sign in to comment.