Skip to content
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

a rule doesn't match whitespace after a '^' anchor with whitespace after it in Rakudo #3195

Closed
p6rt opened this issue Jul 28, 2013 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 28, 2013

Migrated from rt.perl.org#119053 (status was 'resolved')

Searchable as RT119053$

@p6rt
Copy link
Author

p6rt commented Jul 28, 2013

From @masak

<masak> r​: grammar G { rule TOP { ^ <foo> }; rule foo { foo } }; say
?G.parse(" foo")
<camelia> rakudo 96776b​: OUTPUT«False␤»
<masak> I was under the impression that the space between '^' and
'<foo>' would eat the space at the beginning of " foo".
<masak> what am I missing?
<moritz> masak​: I think there's a special case that leading
whitespaces in rules aren't counted as <.ws>
<masak> moritz​: right, but this one isn't leading, it's after the '^'.
<masak> r​: grammar G { rule TOP { ^ <?> <foo> }; rule foo { foo } };
say ?G.parse(" foo")
<camelia> rakudo 96776b​: OUTPUT«False␤»
<masak> and putting more stuff in between doesn't help either...
<masak> if no-one has an explanation I'm going to file a rakudobug.
<masak> S03​:330 has this to say​:
<masak> "Only whitespace sequences immediately following a
<masak> matching construct (atom, quantified atom, or assertion) are eligible."
<masak> but at least <?> is an assertion, no?
<moritz> it is
<moritz> in the very least it's an atom :-)
<masak> heh.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Apr 14, 2014

From @Mouq

On Sun Jul 28 09​:14​:34 2013, masak wrote​:

<masak> r​: grammar G { rule TOP { ^ <foo> }; rule foo { foo } }; say
?G.parse(" foo")
<camelia> rakudo 96776b​: OUTPUT«False␤»
<masak> I was under the impression that the space between '^' and
'<foo>' would eat the space at the beginning of " foo".
<masak> what am I missing?
<moritz> masak​: I think there's a special case that leading
whitespaces in rules aren't counted as <.ws>
<masak> moritz​: right, but this one isn't leading, it's after the '^'.
<masak> r​: grammar G { rule TOP { ^ <?> <foo> }; rule foo { foo } };
say ?G.parse(" foo")
<camelia> rakudo 96776b​: OUTPUT«False␤»
<masak> and putting more stuff in between doesn't help either...
<masak> if no-one has an explanation I'm going to file a rakudobug.
<masak> S03​:330 has this to say​:
<masak> "Only whitespace sequences immediately following a
<masak> matching construct (atom, quantified atom, or assertion) are
eligible."
<masak> but at least <?> is an assertion, no?
<moritz> it is
<moritz> in the very least it's an atom :-)
<masak> heh.
* masak submits rakudobug

Resolved and has a test in S05-modifier/sigspace.t. Closing

@p6rt
Copy link
Author

p6rt commented Apr 14, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 14, 2014

@Mouq - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 14, 2014
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant