Re: perl6-regex: retaining $/.pos after an unsuccesful match without a temporary variable?

2019-08-21 Thread William Michels via perl6-users
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

Re: perl6-regex: retaining $/.pos after an unsuccesful match without a temporary variable?

2019-08-21 Thread yary
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;