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

Parsing bug after }\n #2545

Closed
p6rt opened this issue Nov 1, 2011 · 5 comments
Closed

Parsing bug after }\n #2545

p6rt opened this issue Nov 1, 2011 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Nov 1, 2011

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

Searchable as RT102690$

@p6rt
Copy link
Author

p6rt commented Nov 1, 2011

From @moritz

Rakudo misparses this file​:

my %a; sub c { }
%a<b> = 1;

Output​:

===SORRY!===
CHECK FAILED​:
Undefined routine '&a' called (line 2)

It doesn't parse the } followed by the newline as a statement end.
Thus it parses the following % as an infix op, and 'a' as a subroutine
call. As a workaround, I can add a ; to the end of the first line.

STD parses it correctly.

@p6rt
Copy link
Author

p6rt commented Apr 22, 2012

From @masak

<masak> r​: sub foo($x) {}␤&foo.wrap​: sub ($x) {}
<p6eval> rakudo a8f855​: OUTPUT«===SORRY!===␤CHECK FAILED​:␤Calling
'foo' will never work with no arguments (line 2)␤ Expected​: :($x)␤»
* masak submits rakudobug

jnthn++ concludes that the '&foo.wrap' is read as infix​:<&> +
'foo().wrap', leading to the above error.

In fact, *any* infix operator in place of '&' parses in this way in
Rakudo currently.

jnthn++ also concludes that this is due to the expression parser
gobbling up too much whitespace after the '}'.

@p6rt
Copy link
Author

p6rt commented Mar 9, 2013

From @jnthn

On Tue Nov 01 12​:08​:21 2011, moritz wrote​:

Rakudo misparses this file​:

my %a; sub c { }
%a<b> = 1;

Output​:

===SORRY!===
CHECK FAILED​:
Undefined routine '&a' called (line 2)

It doesn't parse the } followed by the newline as a statement end.
Thus it parses the following % as an infix op, and 'a' as a subroutine
call. As a workaround, I can add a ; to the end of the first line.

STD parses it correctly.

Fixed now, and tests for the problem unfudged, so resolving.

Thanks!

/jnthn

@p6rt
Copy link
Author

p6rt commented Mar 9, 2013

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

@p6rt
Copy link
Author

p6rt commented Mar 9, 2013

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

@p6rt p6rt closed this as completed Mar 9, 2013
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