name: support for string tokentype in switch-case
about: I have added support for string tokentype in 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.
It is an improvement of the existing feature (#79).
Describe your PR
A clear and concise description of what your pull request is changing or adding.
It is adding support for string tokentype in switch-case.
Describe intended use
A clear and concise description of the intended use of the feature. Along with example code.
Now, switch variable can also be a string. Earlier, it could only be a number.
let var = "b";
switch (var) {
case "a" :
// do something.
case "b" :
// do something else.
case "c" :
// do something more.
default :
// do default stuff.
}
How did you fix the bug?
If applicable, how did you fix the bug? Please use code snippets too.
Added TokenType.STRING in the parsing phase.
Is it in the form of a library
No
If applicable what is the library called?
N/A.
Does your PR replace an existing system
If applicable, please describe how this PR changes the use of a related item.
No.
Additional comments
Add any additional comments or screenshots here.
name: support for string tokentype in switch-case about: I have added support for string tokentype in 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 Add any additional comments or screenshots here.