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

💻 Make a better error message for forgotten colons in level 17 #5222

Closed
MarleenGilsing opened this issue Mar 7, 2024 · 0 comments · Fixed by #5465
Closed

💻 Make a better error message for forgotten colons in level 17 #5222

MarleenGilsing opened this issue Mar 7, 2024 · 0 comments · Fixed by #5465
Assignees
Labels
error messages Issues related to Error messages when code is wrong frontend Issue with the web interface

Comments

@MarleenGilsing
Copy link
Collaborator

I was working on level 17 and forgetting to use colons myself. I got error messages saying I can't start a new line, like this one:

image

We could use a better error message for this.

@MarleenGilsing MarleenGilsing added error messages Issues related to Error messages when code is wrong frontend Issue with the web interface labels Mar 7, 2024
@boryanagoncharenko boryanagoncharenko self-assigned this Apr 14, 2024
@mergify mergify bot closed this as completed in #5465 Apr 25, 2024
mergify bot pushed a commit that referenced this issue Apr 25, 2024
- Add preprocessing rules which take an argument in order to allow for a rule to turn into an error without copying the old rule definition. For example, `error_ifelse<old_rule_to_error ifelse>` is used in level 8 to transform the old flat if-else to an error.
- Add errors for if-else statements, loops and function definitions missing a colon in level 17

Fixes #5222

**How to test**
- Automated tests are added for the new preprocessing functionality and for the commands missing colons in level 17.
- To see the error message, run the following program in level 17 and try removing any of the colons at a time. The message should direct you to the right line.
```
define function with b:
    i = 1
    while i < b:
        print i
        i = i + 1

b = 10
if b is 1:
    call function with b
elif b is 2:
    call function with b
else:
    call function with b

if b is pressed:
    call function with b
elif c is pressed:
    call function with b
else:
    call function with b

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Issues related to Error messages when code is wrong frontend Issue with the web interface
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants