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

adding negative number check and solving format #15

Merged
merged 1 commit into from
Oct 10, 2022

Conversation

lucasgpulcinelli
Copy link
Collaborator

partially fixes #11 (and it will be the only work to be done for it)

Copy link
Member

@cirillom cirillom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also warns the user which line the problem appears? Is this even possible?

@lucasgpulcinelli
Copy link
Collaborator Author

Yes! At line 190 of the new file (in except block in preprocess()) you can see a ValueError exception message and the line of the error. You can test the preprocessor by using (at the root of the repo) python src/preprocessor.py res/charmap.json examples/hello_world.asm /tmp/out.asm. If you change, for instance, the postion macro at line 12 of examples/preprocessor.py to include negative numbers, a nice error message is printed and the program fails.

@lucasgpulcinelli
Copy link
Collaborator Author

@cirillom ping to merge the pull request if possible, or show more work to be done

Copy link
Member

@cirillom cirillom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent solution, code is really nice and concise, congrats

@lucasgpulcinelli lucasgpulcinelli merged commit 1f73c45 into main Oct 10, 2022
@lucasgpulcinelli lucasgpulcinelli deleted the negative-value-macros branch October 10, 2022 19:40
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.

User should be warned when $position(arg[0], arg[1]) returns a value outside of the screen
2 participants