Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created August 19, 2017 16:28
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/6e9964d2bdcceb6f8b7a03a8bfa21ef9 to your computer and use it in GitHub Desktop.
Save AlexDaniel/6e9964d2bdcceb6f8b7a03a8bfa21ef9 to your computer and use it in GitHub Desktop.
diff --git a/src/core/Grammar.pm b/src/core/Grammar.pm
index 514b81d2d..445396548 100644
--- a/src/core/Grammar.pm
+++ b/src/core/Grammar.pm
@@ -28,9 +28,13 @@ my class Grammar is Match {
),
$match := ($cursor := $cursor.'!cursor_next'()).MATCH
),
- $match || $grammar.?SETFAIL($match, :$filename)
+ $match || ($grammar.^find_method('SETFAIL').name eq 'SETFAIL'
+ ?? $grammar.SETFAIL($match, :$filename)
+ !! Nil)
),
- $grammar.?SETFAIL($cursor, :$filename)
+ ($grammar.^find_method('SETFAIL').name eq 'SETFAIL'
+ ?? $grammar.SETFAIL($cursor, :$filename)
+ !! Nil)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment