diff --git a/opparser.cc b/opparser.cc index f22c790..eca1e5f 100644 --- a/opparser.cc +++ b/opparser.cc @@ -1195,19 +1195,21 @@ M_INSTR_( If ) return; } - cond.setCase( 1 , parseBlock( cond , input[ 2 ] ) ); - if ( cond.hasCase( 1 ) ) { - cond.getCase( 1 ).location( ) = input[ 2 ].location( ); + cond.setDefaultCase( parseBlock( cond , input[ 2 ] ) ); + if ( cond.hasDefaultCase( ) ) { + cond.defaultCase( ).location( ) = input[ 2 ].location( ); } if ( input.size( ) > 3 ) { - cond.setDefaultCase( parseBlock( cond , input[ 3 ] ) ); - if ( cond.hasDefaultCase( ) ) { - cond.defaultCase( ).location( ) = input[ 3 ].location( ); + cond.setCase( 0 , parseBlock( cond , input[ 3 ] ) ); + if ( cond.hasCase( 0 ) ) { + cond.getCase( 0 ).location( ) = input[ 3 ].location( ); } if ( input.size( ) > 4 ) { errors.addNew( "too many arguments" , input[ 4 ].location( ) ); } + } else { + cond.setCase( 0 , NewOwned< T_InstrListNode >( cond ) ); } }