Skip to content

Instantly share code, notes, and snippets.

@clsn
Created May 7, 2010 17:41
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 clsn/393761 to your computer and use it in GitHub Desktop.
Save clsn/393761 to your computer and use it in GitHub Desktop.
use v6;
grammar Simpl {
token xxx { 'x' }
token c { 'c' }
token end { '!' }
token xc { <xxx>*<c> }
token xend { <xxx>*<end> }
}
my $sample="cx!";
my $answer=($sample ~~ /<Simpl::xend>/);
say $answer.perl;
@clsn
Copy link
Author

clsn commented May 7, 2010

use v6;

# grammar Simpl {
my  token xxx { 'x' }
my  token c { 'c' }
my  token end { '!' }

my  token xc { <xxx>*<c> }
my  token xend { <xxx>*<end> }
# }

my $sample="cx!";
my $answer=($sample ~~ /<xend>/);
say $answer.perl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment