Closed ankitshubham97 closed 5 years ago
Great work. I am just going to hold off merging until it supports more than one line per case.
I will add a WIP tag to the title.
@crazywolf132 Commit 1625e28 now takes care of supporting more than one line per case.
@crazywolf132 I have a query. In src/com/mani/lang/core/Interpreter.java,:
@Override
public Void visitBreakStmt(Stmt.Break stmt) {
throw new Return();
}
Why are we throwing a RuntimeException for 'break' statements? Is it because it is still unimplemented?
@ankitshubham97 That was just how i chose to take care of break statements. If you believe there is a better way, by all means. Feel free to change it.
If you think this is good to go, please create a test case for it. Then we can merge.
@Kalekdan Anything to add?
@crazywolf132 Added test in c098248.
Great work
Thanks! #79 can be closed now.
name: Switch-case about: I have added the feature of switch-case to the language.
Is your PR related to a feature request or Bug report? If applicable, please list feature request number or bug report ID.
Describe your PR A clear and concise description of what your pull request is changing or adding.
Describe intended use A clear and concise description of the intended use of the feature. Along with example code.
How did you fix the bug? If applicable, how did you fix the bug? Please use code snippets too.
Is it in the form of a library
If applicable what is the library called?
Does your PR replace an existing system If applicable, please describe how this PR changes the use of a related item.
Additional comments Limitations:
Does not support "default" keyword for now, added a TODO.Does not support multiple statements within a case, only one statement per case works for now. So, something like following does not work: