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

Strange parsing error involving two spaces #506

Closed
p6rt opened this issue Dec 18, 2008 · 7 comments
Closed

Strange parsing error involving two spaces #506

p6rt opened this issue Dec 18, 2008 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Dec 18, 2008

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

Searchable as RT61494$

@p6rt
Copy link
Author

p6rt commented Dec 18, 2008

From @masak

Rakudo r34064 doesn't allow two spaces between 'say' and 'for' in this
one-liner​:

$ ./perl6 -e 'say for 1'
Could not find non-existent sub for
[...]

@p6rt
Copy link
Author

p6rt commented Dec 19, 2008

From @moritz

# New Ticket Created by "Carl Mäsak"
# Please include the string​: [perl #​61494]
# in the subject line of all future correspondence about this issue.
# <URL​: http://rt.perl.org/rt3/Ticket/Display.html?id=61494 >

Rakudo r34064 doesn't allow two spaces between 'say' and 'for' in this
one-liner​:

$ ./perl6 -e 'say for 1'
Could not find non-existent sub for

Actually I think that's the correct parse, because say() expects an
argument list, so a bare 'for' has to be a sub call. It only parses 'for
1' as a statement modifying loop where an operator is expected.

I'd argue that the parse of 'say for 1' (with only one whitespace) is
incorrect. In case of doubt, ask STD.pm.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Dec 19, 2008

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

@p6rt
Copy link
Author

p6rt commented Dec 19, 2008

From @TimToady

On Fri, Dec 19, 2008 at 10​:04​:34AM +0100, moritz@​casella.faui2k3.org wrote​:
: > # New Ticket Created by "Carl Mäsak"
: > # Please include the string​: [perl #​61494]
: > # in the subject line of all future correspondence about this issue.
: > # <URL​: http://rt.perl.org/rt3/Ticket/Display.html?id=61494 >
: >
: >
: > Rakudo r34064 doesn't allow two spaces between 'say' and 'for' in this
: > one-liner​:
: >
: > $ ./perl6 -e 'say for 1'
: > Could not find non-existent sub for
:
: Actually I think that's the correct parse, because say() expects an
: argument list, so a bare 'for' has to be a sub call. It only parses 'for
: 1' as a statement modifying loop where an operator is expected.
:
: I'd argue that the parse of 'say for 1' (with only one whitespace) is
: incorrect. In case of doubt, ask STD.pm.

STD considers modifiers to be terminators, so 'for' will never be
interpreted as a listop. I just fixed STD so that 'say for()' lets
you call the for() function, however.

Larry

@p6rt
Copy link
Author

p6rt commented Jul 12, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in b/t/spec/S04-statement-modifiers/for.t

@p6rt
Copy link
Author

p6rt commented Mar 20, 2010

From @masak

This particular parsefail doesn't occur anymore in ng. Resolving ticket.

@p6rt
Copy link
Author

p6rt commented Mar 20, 2010

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

@p6rt p6rt closed this as completed Mar 20, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant