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

Feat: after termination instructions return, break, continue do not allow other instructions #15

Merged
merged 3 commits into from
Nov 11, 2023

Conversation

mrLSD
Copy link
Owner

@mrLSD mrLSD commented Nov 8, 2023

Description

After termination instructions return, break, and continue, if other instructions presented added errors to state. Related to issue #10.

:octocat: Added additional tests that covers is it impossible to set exctra instructions after termination instructions.

This applies to statements:

  • function-body
  • if-body
  • else-if-body
  • if-loop-body
  • else-if-loop-body
  • loop-body

Loops

🏁 Checked if the return instruction was present, then removed extra jump-to: loop-end, and set-label: loop-end. And added the tests.

@mrLSD mrLSD self-assigned this Nov 8, 2023
@mrLSD mrLSD added this to the v0.2.6 milestone Nov 8, 2023
@mrLSD mrLSD added the enhancement New feature or request label Nov 8, 2023
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
src/semantic.rs 100.00% <100.00%> (ø)
src/types/error.rs 100.00% <ø> (ø)

... and 14 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

@mrLSD mrLSD merged commit 5ad44c2 into master Nov 11, 2023
3 of 4 checks passed
@mrLSD mrLSD deleted the feat/after-return-cleanup-instructions branch November 11, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant