mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Removed some old notes
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
|
||||
//source
|
||||
|
||||
while (true) {
|
||||
print "1";
|
||||
break;
|
||||
print "2";
|
||||
}
|
||||
|
||||
print "3";
|
||||
|
||||
//asm
|
||||
|
||||
0 TOY_OPCODE_READ [TOY_VALUE_BOOLEAN, true, -]
|
||||
4 TOY_OPCODE_JUMP [TOY_OP_PARAM_JUMP_RELATIVE, TOY_OP_PARAM_JUMP_IF_FALSE, -]
|
||||
8 52 (jumps to end '64' after this JUMP instruction)
|
||||
12 TOY_OPCODE_SCOPE_PUSH
|
||||
16 TOY_OPCODE_READ [TOY_VALUE_STRING, TOY_STRING_LEAF, 0]
|
||||
20 0 (string "1")
|
||||
24 TOY_OPCODE_PRINT
|
||||
28 TOY_OPCODE_ESCAPE
|
||||
32 0? (addr)
|
||||
36 0? (diff)
|
||||
40 TOY_OPCODE_READ [TOY_VALUE_STRING, TOY_STRING_LEAF, 0]
|
||||
44 4 (string "2")
|
||||
48 TOY_OPCODE_PRINT
|
||||
52 TOY_OPCODE_SCOPE_POP
|
||||
56 TOY_OPCODE_JUMP [TOY_OP_PARAM_JUMP_RELATIVE, TOY_OP_PARAM_JUMP_ALWAYS, -]
|
||||
60 -64 (jumps to start '0' after this JUMP instruction)
|
||||
64 TOY_OPCODE_READ [TOY_VALUE_STRING, TOY_STRING_LEAF, 0]
|
||||
68 8 (string "3")
|
||||
72 TOY_OPCODE_PRINT
|
||||
76 TOY_OPCODE_RETURN
|
||||
@@ -1,3 +0,0 @@
|
||||
type coercion
|
||||
permanent strings?
|
||||
concat & free? (strings)
|
||||
@@ -1,28 +0,0 @@
|
||||
TOY_OPCODE_DECLARE:
|
||||
{Declare, type, length, 0} ; {emitString()}
|
||||
|
||||
# write value
|
||||
TOY_OPCODE_READ:
|
||||
null -> {Read, type, 0, 0}
|
||||
bool -> {Read, type, value, 0}
|
||||
int -> {Read, type, 0, 0} ; {value}
|
||||
float -> {Read, type, 0, 0} ; {value}
|
||||
string -> {Read, type, leaf, 0} ; {emitString()}
|
||||
|
||||
# write assignment
|
||||
TOY_AST_FLAG_ASSIGN:
|
||||
{Read, type(string), name, length} ;
|
||||
{emitString()} ;
|
||||
{writeCode()} ;
|
||||
{Assign, 0, 0, 0} ;
|
||||
|
||||
TOY_AST_FLAG_ADD_ASSIGN:
|
||||
{Read, type(string), name, length} ;
|
||||
{emitString()} ;
|
||||
{Duplicate, 0, 0, 0} ;
|
||||
{writeCode()} ;
|
||||
{Assign, 0, 0, 0}
|
||||
{Add, Assign, 0, 0} ;
|
||||
|
||||
//subtract, multiply, divide, modulo all mimic add
|
||||
|
||||
Reference in New Issue
Block a user