Skip to content

Instantly share code, notes, and snippets.

Created July 12, 2011 15:15
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 anonymous/1078177 to your computer and use it in GitHub Desktop.
Save anonymous/1078177 to your computer and use it in GitHub Desktop.
pmichaud@kiwi:~/qregex$ cat z
grammar ABC {
regex abc { abc }
regex def { <abc> }
}
my $cursor := ABC."!cursor_init"('abc');
my $c := $cursor.def();
_dumper($c.MATCH);
pmichaud@kiwi:~/qregex$ ./nqpq z
"VAR1" => PMC 'NQPMatch' {
NQPMatch::$!orig => "abc"
NQPMatch::$!from => 0
NQPMatch::$!to => 3
NQPMatch::$!ast => null
NQPMatch::$!cursor => null
NQPCapture::@!array => ResizablePMCArray (size:0) [
]
NQPCapture::%!hash => Hash {
"abc" => PMC 'NQPMatch' {
NQPMatch::$!orig => \VAR1
NQPMatch::$!from => 0
NQPMatch::$!to => 3
NQPMatch::$!ast => null
NQPMatch::$!cursor => null
NQPCapture::@!array => ResizablePMCArray (size:0) [
]
NQPCapture::%!hash => Hash {
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment