-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Bug] Wrong line number reporting of (red) Syntax error in code editor #354
Comments
In Python and MicroPython, it is allowable to continue on the next line after an As a side note, I actually read somewhere recently that CPython got a compiler upgrade that will actually report the error on the line with the |
Although, we may be able to add other checkers to Pybricks code in the future that perform additional analysis. The trick is being able to run Python in the web browser or find JavaScript/TypeScript tools for analyzing Python code. |
Yes, and here are two more ideas for you to kick around:
|
I should add that in the case of missing : you can test the hypothesis by adding a : and re-parsing and see if it passes. I have done this to great success with missing ; against a weak Java parser. |
Symptom:
if there is a syntax error caused in the middle of a line, the editor reports the correct line number where the error occurred. see attachment: code_editor_syntax_error_within_line.png
Here, as an example in line 10, the left parenthesis in Motor Port.A) is missing
Line number is correctly shown.
if there is a syntax error caused by the last character of a line, the editor reports instead the error being in the next line (line+1). see attachment: code_editor_syntax_error_end_of_line.png
Here, as an example in line 10, the right parenthesis in Motor (Port.A is missing.
Line number is not correct. It shows 11 instead of 10
It goes for all types of instructions as long as it is the last character of the line.
Also, it applies to both the webpage editor and the chrome app install.
Environment:
Linux Mint 20.1 Ulyssa
Chrome Version 91.0.4472.77
The text was updated successfully, but these errors were encountered: