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

LTA error message when doing with() { } with no whitespace before () #4472

Closed
p6rt opened this issue Aug 15, 2015 · 4 comments
Closed

LTA error message when doing with() { } with no whitespace before () #4472

p6rt opened this issue Aug 15, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Aug 15, 2015

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

Searchable as RT125812$

@p6rt
Copy link
Author

p6rt commented Aug 15, 2015

From @AlexDaniel

Code​:
with(1) { }

Result​:
===SORRY!=== Error while compiling ./test.pl
Unexpected block in infix position (missing statement control word before
the expression?)
at ./test.pl​:2
------> with(1)⏏ { }
  expecting any of​:
  infix
  infix stopper

It looks like “with” and “without” are missing some checks, unlike “if”,
“unless”. Here is what happens if you use if​:
===SORRY!===
Word 'if' interpreted as 'if()' function call; please use whitespace
instead of parens
at ./test.pl​:2
------> if⏏(1) { }
Unexpected block in infix position (two terms in a row)
at ./test.pl​:2
------> if(1)⏏ { }

In other words, “with” and “without” should produce same error message
about whitespace.

IRC log​: http://irclog.perlgeek.de/perl6/2015-08-15#i_11061258

@p6rt
Copy link
Author

p6rt commented Sep 5, 2015

From @jnthn

On Fri Aug 14 19​:39​:48 2015, alex.jakimenko@​gmail.com wrote​:

Code​:
with(1) { }

Result​:
===SORRY!=== Error while compiling ./test.pl
Unexpected block in infix position (missing statement control word before
the expression?)
at ./test.pl​:2
------> with(1)⏏ { }
expecting any of​:
infix
infix stopper

It looks like “with” and “without” are missing some checks, unlike “if”,
“unless”. Here is what happens if you use if​:
===SORRY!===
Word 'if' interpreted as 'if()' function call; please use whitespace
instead of parens
at ./test.pl​:2
------> if⏏(1) { }
Unexpected block in infix position (two terms in a row)
at ./test.pl​:2
------> if(1)⏏ { }

In other words, “with” and “without” should produce same error message
about whitespace.

Fixed and tests added in S32-exceptions/misc.t.

@p6rt
Copy link
Author

p6rt commented Sep 5, 2015

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

@p6rt
Copy link
Author

p6rt commented Sep 5, 2015

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

@p6rt p6rt closed this as completed Sep 5, 2015
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