[issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop

2022-03-07 Thread Jonathan Fine
Jonathan Fine added the comment: My main concern is that the door not be closed on improving the user experience relating to this behaviour of the compiler. This issue was raised as a bug for the compiler (which is C-coded). I'd be very happy for this issue to be closed as 'not a bug' for th

[issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop

2022-03-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Unfortunately that's not how the parser works. I insist, for the compiler to raise the propper error the parser needs to succeed first. That would require us to modify the input string in arbitrary ways (many times we don't know exactly what went wron

[issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop

2022-03-04 Thread Jonathan Fine
Jonathan Fine added the comment: Many thanks Pablo for the clear explanation. I'd prefer that the issue remain open, as there's an important user experience issue here. I suspect there are other similar examples of how the compiler error messages could be improved. Here's a change that doesn

[issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop

2022-03-03 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Unfortunately, we cannot do much here. The reason is that the parser allows break and continue outside loops as they count as statements. As these are associated with control flow, is the compiler the one that will show the Syntax warning once it trie

[issue46910] Expect IndentationError, get SyntaxError: 'break' outside loop

2022-03-03 Thread Jonathan Fine
New submission from Jonathan Fine : This arises from a request for help made by Nguyễn Ngọc Tiến to the visually impaired programmers lists, see https://www.freelists.org/post/program-l/python,48. Please keep this in mind. Nguyễn asked for help with the syntax error created by === count = 0 wh