Skip to content

Instantly share code, notes, and snippets.

@perl6
Created May 28, 2009 07:26
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 perl6/119159 to your computer and use it in GitHub Desktop.
Save perl6/119159 to your computer and use it in GitHub Desktop.
$ cat z
grammar ABC {
token TOP { abc | <oops: "Failed to find abc!"> }
method oops($msg) { die $msg; }
}
ABC.parse('xyz');
$ ./perl6 z
Failed to find abc!
in method ABC::oops (z:3)
called from regex ABC::TOP (z:1)
called from Main (z:6)
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment