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

Failure to parse [[<a>],] #6375

Closed
p6rt opened this issue Jul 4, 2017 · 3 comments
Closed

Failure to parse [[<a>],] #6375

p6rt opened this issue Jul 4, 2017 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 4, 2017

Migrated from rt.perl.org#131701 (status was 'rejected')

Searchable as RT131701$

@p6rt
Copy link
Author

p6rt commented Jul 4, 2017

From @zoffixznet

Works (space between brackets and <a>)​:

  $ perl6 -e 'dd [[ <a>],]'
  [["a"],]

Doesn't (no space)​:

  $ perl6 -e 'dd [[<a>],]'
  ===SORRY!=== Error while compiling -e
  Unable to parse expression in bracketed infix; couldn't find final ']'
  at -e​:1
  ------> dd [[<⏏a>],]

@p6rt
Copy link
Author

p6rt commented Jul 5, 2017

From @zoffixznet

On Tue, 04 Jul 2017 09​:20​:18 -0700, cpan@​zoffix.com wrote​:

Works (space between brackets and <a>)​:

$ perl6 \-e 'dd \[\[ \<a>\],\]'
\[\["a"\],\]

Doesn't (no space)​:

$ perl6 \-e 'dd \[\[\<a>\],\]'
===SORRY\!=== Error while compiling \-e
Unable to parse expression in bracketed infix; couldn't find final '\]' 
at \-e&#8203;:1
\-\-\-\-\-\-> dd \[\[\<⏏a>\],\]

This isn't a bug but By Design. There's a formal ambiguity between Array constructors and reductions, and the way to resolve them is to use a space​:

https://irclog.perlgeek.de/perl6-dev/2017-07-05#i_14830532

@p6rt
Copy link
Author

p6rt commented Jul 5, 2017

@zoffixznet - Status changed from 'new' to 'rejected'

@p6rt p6rt closed this as completed Jul 5, 2017
@p6rt p6rt added the parser 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