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

[LANGUAGE] Convert calc to int in sleep level 12 #4677

Merged
merged 20 commits into from
Nov 21, 2023
Merged

[LANGUAGE] Convert calc to int in sleep level 12 #4677

merged 20 commits into from
Nov 21, 2023

Conversation

Felienne
Copy link
Member

@Felienne Felienne commented Oct 27, 2023

Fixes #4672

This PR does three things to improve weird error messages.

Firstly, it escapes the library name time, fixing error number three named in #4672:

image

It also converts sleep input to integers, so that you can use fractions (error number 1):

image

And it allows floats as input for sleep in level 12 and up, fixing error 2:

image

How to test
I added tests for all cases

@ghost
Copy link

ghost commented Oct 27, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@Felienne Felienne changed the title [LANGUAGE] Convert calc to in in sleep level 12 [LANGUAGE] Convert calc to int in sleep level 12 Oct 27, 2023
@Felienne Felienne marked this pull request as ready for review November 18, 2023 12:56
@Felienne
Copy link
Member Author

Felienne commented Nov 18, 2023

Hi @ToniSkulj!

This change to the handling of sleep messes up one of your tests :( (see: 6e57009)

I have disabled it for now (since I don't exactly understand why it fails, it does not seem to see an inner error production?) Would be great if you can take a look, either in this PR or in a fresh one.

Thanks!

@ToniSkulj
Copy link
Member

Would be great if you can take a look, either in this PR or in a fresh one.

Hi @Felienne! Of course! bc2ec53 fixes the test in level 16.

Essentially what happens is that when skipping error_list_access_at the transpiling is accidentally still correct.
Fixed it by checking if we skipped an error and if so we can manually raise an error now.

@Felienne Felienne requested a review from jpelay November 20, 2023 05:45
@jpelay
Copy link
Member

jpelay commented Nov 20, 2023

Hi @Felienne! It all works great, but since we are allowing float variables to be used with sleep, we probably want float literals to be allowed to

image

@Felienne
Copy link
Member Author

Hi @Felienne! It all works great, but since we are allowing float variables to be used with sleep, we probably want float literals to be allowed to

image

Ah great catch, should be easy to allow. I will add that too in this PR!

@Felienne
Copy link
Member Author

Should be ready to go now @jpelay!

Copy link
Contributor

mergify bot commented Nov 21, 2023

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 4e33e30 into main Nov 21, 2023
11 checks passed
@mergify mergify bot deleted the catch-all branch November 21, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Improve error message
3 participants