Skip to content

Instantly share code, notes, and snippets.

View patrickbkr's full-sized avatar

Patrick Böker patrickbkr

View GitHub Profile
@patrickbkr
patrickbkr / converter.pl6
Last active August 29, 2015 14:16
Propagating Cursor state
#!/usr/bin/env perl6
grammar Tracker {
regex TOP {
{ make {:!inQuote} }
Beginning
<quoteStart>
.*
<laterRule>
End
@patrickbkr
patrickbkr / gist:5fd2380e8bbe140b22f3
Created February 26, 2015 18:00
State and backtracking
#!/usr/bin/env perl6
grammar Tracker {
regex TOP {
:my %*QUOTE_TRACKER;
Beginning
[ <quote> || .*! ]
End { say "failure" if %*QUOTE_TRACKER<inQuote> == True }
}