Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created August 19, 2017 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDaniel/ee235150468db3ee545e7925b398d4c8 to your computer and use it in GitHub Desktop.
Save AlexDaniel/ee235150468db3ee545e7925b398d4c8 to your computer and use it in GitHub Desktop.
diff --git a/src/core/Grammar.pm b/src/core/Grammar.pm
index 514b81d2d..b80ca248c 100644
--- a/src/core/Grammar.pm
+++ b/src/core/Grammar.pm
@@ -28,9 +28,11 @@ my class Grammar is Match {
),
$match := ($cursor := $cursor.'!cursor_next'()).MATCH
),
- $match || $grammar.?SETFAIL($match, :$filename)
+ $match || nqp::if(nqp::can($grammar, 'SETFAIL'),
+ $grammar.SETFAIL($match, :$filename), Nil)
),
- $grammar.?SETFAIL($cursor, :$filename)
+ nqp::if(nqp::can($grammar, 'SETFAIL'),
+ $grammar.SETFAIL($cursor, :$filename), Nil)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment