-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
TSL Transpiler - Add Support for Switch Statements #31272
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
Conversation
|
I tested with this example but it doesn't seem to be working yet.
Result Switch(x).Case(int( 0 ), () => {
result.assign( int( 10 ) );
break;
} ).Default( () => {
result.assign( int( 20 ) );
break;
} ).Default( () => {
result.assign( int( 30 ) );
break;
} ); |
I will look at it later today and convert to draft for now. I'm not sure how comments work but it seems like the Decoder just ignores them in most instances. |
Is this how we generally want to style cases for switch statements in future TSL examples? (code output from latest commit) Switch( x )
.Case( int( 0 ), () => {
result.assign( int( 10 ) );
Break();
} ).Case( int( 1 ), () => {
result.assign( int( 20 ) );
Break();
} ).Case( int( 2 ), () => {
result.assign( int( 30 ) );
Break();
} );
return result; Also, though I do appreciate getting these changes in as soon as possible, I would appreciate some communication about requested code style, indentation changes, or missing/expected features in a code review rather than seeing them in a commit later on before I can attempt to address the issues myself. I largely use these PRs as an opportunity to improve myself as a programmer, and I would like to be involved in finishing and fully understanding the projects I start. If there's anything I can do on my end in terms of improving communication or my own code style to align it more with the project, please let me know. |
@cmhhelgeson Sure, we can do it like that in the next PR's and thanks for collaborating once again. About the style, I wouldn't say it's definitive, it seems easier to read, we can continue like this for now. |
Related issue: #30900, #30849
Description
Adds transpiler support for switches.