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
error message when a semicolon is missing before a while loop (my $x = 5 while True {}) #5852
Comments
From @AlexDanielCode: while True { Result: 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. |
From mefzz@cpan.orgOn Sat, 03 Dec 2016 07:51:07 -0800, alex.jakimenko@gmail.com wrote:
This is a good suggestion, I would say. The error information is a bit complex for a very simple semicolon missing. |
Well, I have hit the same thing forgetting a semicolon with the first example code in Morris Lentz' book, Raku Fundamentals : A Primer with Examples, Projects, and Case Studies, and this is an especially devilish error if one is also often working with languages that do not require semicolons to end statements. I had # file sudoku.p6
use v6.d;
my $sudoku = '000000075000080094000500600010000200000900057006003040001000023080000006063240000'
for 0..8 -> $line-number {
say substr $sudoku, $line-number * 9, 9;
}
but should have had # file sudoku.p6
use v6.d;
my $sudoku = '000000075000080094000500600010000200000900057006003040001000023080000006063240000';
for 0..8 -> $line-number {
say substr $sudoku, $line-number * 9, 9;
} And yeah, it returned
|
Fits the very definition of LTA!!! |
Migrated from rt.perl.org#130251 (status was 'new')
Searchable as RT130251$
The text was updated successfully, but these errors were encountered: