Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created December 6, 2016 13:56
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 zoffixznet/7e368cb00e2e5385ef12473ebaa6cdba to your computer and use it in GitHub Desktop.
Save zoffixznet/7e368cb00e2e5385ef12473ebaa6cdba to your computer and use it in GitHub Desktop.
rule statement_control:sym<without> {
$<sym>='without' <.kok> {}
<xblock(1)> # 1 means we're not parsing `unless`
[ <!before [els[e|if]|orwith]» >
|| $<wrong-keyword>=[els[e|if]|orwith]»
<.typed_panic: 'X::Syntax::WithoutElse',
keyword => ~$<wrong-keyword>,
>
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment