New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rule's capture ws #478
Comments
From martin@martinkjeldsen.dkWhen using rules at least with <ws> overwritten, the rule also captures It is tested with revision 33823. Martin |
From martin@martinkjeldsen.dkgrammar NG { #whitespace rules is borrowed from pipp token singlelinecomment { [ '#' || '//' ] \N* } # end of line comment like Unix shell and C++ token multilinecomment { '/*' .*? '*/' } # C-like multiline comment token ws_all { token ws { rule line { my $str = 'default testtesttest $str ~~ NG; die("No match") unless ~$/; say $/<line>[0]; |
From @moritzMartin Kjeldsen (via RT) wrote:
You're right that there's a bug, but the real issue is that 'token ws { grammar A { if 'xab' ~~ m/ ^ <A::b> $/ { Thank you for your report, |
The RT System itself - Status changed from 'new' to 'open' |
From @chrisdolanOn Dec 13, 2008, at 3:44 AM, Moritz Lenz wrote:
In which case, the root cause may be the same as Chris |
From @moritzMoritz Lenz wrote:
The output is still "no match" for me, but the tests I've added to Cheers, |
From martin@martinkjeldsen.dkMoritz Lenz via RT (09:23 2008-12-14):
Hi Moritz, you're right, I can't get your example to work. But I think you meant if 'xay' ~~ m/ ^ <A::b> $/ { # y instead of b in string and shouldn't it be rule b {'x' 'y'}; or doesn't that matter (I don't know). But no matter it still doesn't work for some reason. But more importantly if the whole problem is the <ws> is not overwritten I don't Martin |
From @pmichaudOn Mon Dec 15 03:43:26 2008, baest wrote:
The following version works fine for me: $ cat x if 'xay' ~~ m/^ <A::b> $/ { say 'match'; } $ ./parrot perl6.pbc x So, clearly the <ws> rule is being called. See next reply for the other example. Pm |
From @pmichaudOn Fri Dec 12 04:52:12 2008, baest wrote:
The problem is with trying to invoke the rule using "$str ~~ NG::TOP" -- Using "$str ~~ /<NG::TOP>/" instead gets the correct match -- see Marking ticket as resolved, thanks! Pm |
From @pmichaud$ cat NG.pl #whitespace rules is borrowed from pipp # end of line comment like Unix shell and C++ # C-like multiline comment token ws_all { token ws { <.ws_all>* } rule line { my $str = 'default testtesttest $str ~~ /<NG::TOP>/; die("No match") unless ~$/; say $<NG::TOP><line>[0]; $ ./parrot perl6.pbc NG.pl |
@pmichaud - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#61308 (status was 'resolved')
Searchable as RT61308$
The text was updated successfully, but these errors were encountered: