handle the block operator

This commit is contained in:
Volker Berlin 2018-05-03 22:57:44 +02:00
parent 02c76d407e
commit 987d26de64
3 changed files with 10 additions and 0 deletions

View File

@ -635,6 +635,10 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
case DROP: case DROP:
codeStream.write( DROP ); codeStream.write( DROP );
break; break;
case BLOCK:
codeStream.write( BLOCK );
codeStream.write( 0x40 ); // void; the return type of the block. currently we does not use it
break;
default: default:
throw new Error( "Unknown block: " + op ); throw new Error( "Unknown block: " + op );
} }

View File

@ -29,4 +29,6 @@ public enum BlockOperator {
END, END,
GOTO, GOTO,
DROP, DROP,
BLOCK,
SWITCH,
} }

View File

@ -271,6 +271,10 @@ public class TextModuleWriter extends ModuleWriter {
case DROP: case DROP:
name = "drop"; name = "drop";
break; break;
case BLOCK:
name = "block";
insetAfter++;
break;
default: default:
throw new Error( "Unknown block: " + op ); throw new Error( "Unknown block: " + op );
} }