Hi Raymond, Wow that's exciting! I'm sure others will chime in with
their thoughts.
I wrote two more test cases for your "incremental P5-like parser",
that can be appended to the code you posted yesterday (personally I
think of incremental matching as being important for matching the
linear order
More literal transcription of your original code is to allow
zero-length match, which maintains "pos", and then checking the match
length.
#!/usr/bin/env perl6
use v6.c;
given " foo bar" {
die unless m/^\s+/;
die unless m:p/ foo\s+ /;
die if m:p/[ willnotmatch ]?/ && $/.chars;