feat: standalone .ly interpreter - parses blocks/wires, executes flow control
This commit is contained in:
1 parent
c4815c3c69
commit
f85c7e37f1
5 files changed
+325
-116
No files matched your search
@@ -26,10 +26,9 @@ void workspace_destroy(BlockWorkspace* ws) {
|
||||
int workspace_add_block(BlockWorkspace* ws, Block* block) {
|
||||
if (ws->block_count >= MAX_WORKSPACE_BLOCKS) return -1;
|
||||
if (!block) return -1;
|
||||
|
||||
block->id = ws->next_block_id++;
|
||||
if (block->id <= 0) block->id = ws->next_block_id++;
|
||||
else if (block->id >= ws->next_block_id) ws->next_block_id = block->id + 1;
|
||||
block->workspace = ws;
|
||||
|
||||
ws->blocks[ws->block_count++] = block;
|
||||
return block->id;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user