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

Add if/else statements #84

Merged
merged 13 commits into from
Jul 23, 2021
Merged

Add if/else statements #84

merged 13 commits into from
Jul 23, 2021

Conversation

MysteryBlokHed
Copy link
Owner

@MysteryBlokHed MysteryBlokHed commented Jul 23, 2021

Closes #83

Adds support for if/else statements. The keyword runif was used instead of if to avoid conflicting with the execute if command.

  • Implement if/else statements
    • Add if statements
    • Add else statements
    • Make parse_shorthand run recursively until no if statements/while loops are left
    • Make sure that if statements cannot modify the result of the condition test
  • Add tests
  • Add documentation
    • Update syntax table
    • Add examples

@github-actions github-actions bot added the source Affects the project's source label Jul 23, 2021
@MysteryBlokHed MysteryBlokHed added this to the v0.6 milestone Jul 23, 2021
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jul 23, 2021
@MysteryBlokHed
Copy link
Owner Author

Testing the output of code that generates if statements might be hard to do if there's more than one, but some code from the while loop tests could probably be reused.

@MysteryBlokHed
Copy link
Owner Author

A new issue (#85) has been added that will make easier testing of if/else statements and while loops possible.
Until then, I think it's alright to merge this, since nested/multiple if statements have been tested and the code likely won't be modified any time soon.

@MysteryBlokHed MysteryBlokHed marked this pull request as ready for review July 23, 2021 16:54
@MysteryBlokHed MysteryBlokHed merged commit 8afd0ec into master Jul 23, 2021
@MysteryBlokHed MysteryBlokHed deleted the 83-if-else branch July 23, 2021 16:54
MysteryBlokHed added a commit that referenced this pull request Jul 23, 2021
MysteryBlokHed added a commit that referenced this pull request Jul 23, 2021
Fixes some problems in #84 that weren't noticed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation source Affects the project's source tests Affects the project's tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] If and else
1 participant