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

added run method and 2 constants for FINAL_FP and FINAL_PC #13

Merged
merged 8 commits into from
Apr 9, 2024

Conversation

KeneePatel
Copy link
Contributor

Run implementation

Time spent on this PR: 0.2 days

Pull request type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Does not have a run method. Relies on runUntilPc for running program.

Resolves #5

What is the new behavior?

Have implemented a run method which executes steps until current PC becomes FINAL_PC i.e. when pc == FINAL_PC

Good things:

  • It works

Bad things:

  • Very basic
  • hard coded starting pc value, and does not take into consideration the number of args. Works for functions with exactly one argument
  • would need refactoring or change soon when extending other behaviour or features.

@KeneePatel
Copy link
Contributor Author

Oh forgot to mention that the stop condition for run is both when pc == FINAL_PC or when pc == FINAL_FP because I noticed the last execution step makes pc <FINAL_FP> due to current implementation of step().

Copy link
Owner

@ClementWalter ClementWalter left a comment

Choose a reason for hiding this comment

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

check the Step function in the ui to start run from the current step plz

src/vm.ts Outdated Show resolved Hide resolved
src/vm.ts Outdated Show resolved Hide resolved
@ClementWalter ClementWalter merged commit dca3d6c into ClementWalter:main Apr 9, 2024
1 check passed
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.

feat: add a Run method
2 participants