Hi!

Is there a script or does anyone have a ready to use regex to turn a
switch statement into a series of if else statements (Java/C)?

For example:

switch (shoeSize) {
    case 8:
        foo();

    case 9:
        bar();

    default:
        baz();
}

into

if (shoeSize == 8) {
    foo();
} else if (shoeSize == 9) {
    bar();
} else {
    baz();
}

It doesn't need to handle case blocks with or without break statements
correctly.


Regards,
Dennis Benzinger

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to