Document expression-less switch statement in Winxed
completed by: Aleksandar
mentors: Andrew Whitworth
Task Description
Most programmers are familiar with the switch/case statement from C and C-like languages. Winxed provides a version of this same syntax as well. The Winxed version does not require an expression in the switch statement. For instance, you can write:
switch {
case a == b: ...
case a == 4: ...
}
This version of the syntax, the "expression-less switch" is not well documented or tested. Do the following:
- Look for examples of the expression-less switch statement. There are several examples in the Winxed compiler source (winxedst1.winxed)
- Add at least two tests to the Winxed compiler test suite for the expression-less switch statement.
- Add a description and code examples for regular switch and expression-less switch syntaxes to the documentation on the Rosella website.
Steps To Complete This Task
- Create a fork of winxed.git on github.com
- Add tests for expression-less switch syntax to a new test file t/basic/04switch.t
- Create a Github pull request (button on the upper right of your fork) to have your changes incorporated into the Winxed master repository
- Create a fork of Rosella.git on github.com
- Check out the gh-pages branch
- Add documentation for switch statements to winxed/syntaxandtypes.md, following existing formatting cues
- Create a Github pull request (button on the upper right of your fork) to have your changes incorporated into the Rosella master repository
Benefits
- Adding tests for existing features helps to ensure that they work as expected and they do not break over time.
- Adding documentation for existing features helps to teach users about them, and helps users to start using them.
Requirements
- Familiarity with Java, C# and/or JavaScript (Winxed is based on these)