Skip Menu |
Report information
Id: 130251
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [LTA] error message when a semicolon is missing before a while loop (my $x = 5 while True {})
Download (untitled) / with headers
text/plain 516b
Code: my $x = 5 while True { } Result: ===SORRY!=== Error while compiling -e Unexpected block in infix position (missing statement control word before the expression?) at -e:3 ------> while True⏏ { expecting any of: infix infix stopper So it is parsed as a statement modifier, that's fine, but the problem is that the error message is way off whet it trips over a block. “Did you forget a semicolon on the previous line?” would be a good addition, but we'd need some heuristic for that.
Download (untitled) / with headers
text/plain 849b
On Sat, 03 Dec 2016 07:51:07 -0800, alex.jakimenko@gmail.com wrote: Show quoted text
> Code: > my $x = 5 > > while True { > } > > Result: > ===SORRY!=== Error while compiling -e > Unexpected block in infix position (missing statement control word > before the expression?) > at -e:3 > ------> while True⏏ { > expecting any of: > infix > infix stopper > > > So it is parsed as a statement modifier, that's fine, but the problem > is that the error message is way off whet it trips over a block. “Did > you forget a semicolon on the previous line?” would be a good > addition, but we'd need some heuristic for that.
This is a good suggestion, I would say. The error information is a bit complex for a very simple semicolon missing. -- 'There is only two types of testing. One, a testing by the developer. Two, a testing by the end user.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org