Chunks of Bytecode 14
This commit is contained in:
parent
848c846e09
commit
7fa01b4fb9
5 changed files with 102 additions and 0 deletions
20
src/clox/main.d
Normal file
20
src/clox/main.d
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
module clox.main;
|
||||
|
||||
import std.stdio;
|
||||
|
||||
import clox.chunk;
|
||||
import clox.dbg;
|
||||
|
||||
int main(string[] argv){
|
||||
Chunk chunk;
|
||||
|
||||
ubyte constant = chunk.addConstant(1.2);
|
||||
chunk.write(OpCode.OP_CONSTANT);
|
||||
chunk.write(constant);
|
||||
|
||||
chunk.write(OpCode.OP_RETURN);
|
||||
|
||||
disassembleChunk(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue