Decompile getting generating bad switch blocks

Not sure if it's the nested switchs that are confusing it or if all the switches are doing this.
But in any case VS does not like the missing "break;"s

[Bad]
        switch (this.theA)
        {
          case 10:
            switch (this.theB)
            {
              case 43:
              case 45:
              case 91:
              case 123:
              case 40:
                this.action(1);
                break;
              case 32:
                this.action(3);
                break;
              default:
                if (this.isAlphanum(this.theB))
                {
                  this.action(1);
                  break;
                }
                this.action(2);
                break;
            }
          case 32:
            if (this.isAlphanum(this.theB))
            {
              this.action(1);
              break;
            }
            this.action(2);
            break;
          default:
            switch (this.theB)
            {
              case 10:
                switch (this.theA)
                {
                  case 93:
                  case 125:
                  case 34:
                  case 39:
                  case 41:
                  case 43:
                  case 45:
                    this.action(1);
                    break;
                  default:
                    if (this.isAlphanum(this.theA))
                    {
                      this.action(1);
                      break;
                    }
                    this.action(3);
                    break;
                }
              case 32:
                if (this.isAlphanum(this.theA))
                {
                  this.action(1);
                  break;
                }
                this.action(3);
                break;
              default:
                this.action(1);
                break;
            }
        }
[/Bad]

[Good]
                switch (this.theA)
                {
                    case 10:
                        {
                            switch (this.theB)
                            {
                                case 43:
                                case 45:
                                case 91:
                                case 123:
                                case 40:
                                    {
                                        this.action(1);
                                        break;
                                    }
                                case 32:
                                    {
                                        this.action(3);
                                        break;
                                    }
                                default:
                                    {
                                        if (this.isAlphanum(this.theB))
                                        {
                                            this.action(1);
                                            break;
                                        }
                                        this.action(2);
                                        break;
                                    }
                            }
                            break;
                        }
                    case 32:
                        {
                            if (this.isAlphanum(this.theB))
                            {
                                this.action(1);
                                break;
                            }
                            this.action(2);
                            break;
                        }
                    default:
                        {
                            switch (this.theB)
                            {
                                case 10:
                                    {
                                        switch (this.theA)
                                        {
                                            case 93:
                                            case 125:
                                            case 34:
                                            case 39:
                                            case 41:
                                            case 43:
                                            case 45:
                                                {
                                                    this.action(1);
                                                    break;
                                                }
                                            default:
                                                {
                                                    if (this.isAlphanum(this.theA))
                                                    {
                                                        this.action(1);
                                                        break;
                                                    }
                                                    this.action(3);
                                                    break;
                                                }
                                        }
                                        break;
                                    }
                                case 32:
                                    {
                                        if (this.isAlphanum(this.theA))
                                        {
                                            this.action(1);
                                            break;
                                        }
                                        this.action(3);
                                        break;
                                    }
                                default:
                                    {
                                        this.action(1);
                                        break;
                                    }
                            }
                            break;
                        }
                }
[/Good]

0

Please sign in to leave a comment.