typedef enum BlockRule {
Block_Rule_New_Scope = BH_BIT(1),
- Block_Rule_Clear_Defer = BH_BIT(2),
- Block_Rule_Override_Return = BH_BIT(3),
+ Block_Rule_Emit_Instructions = BH_BIT(2),
+ Block_Rule_Clear_Defer = BH_BIT(3),
+ Block_Rule_Override_Return = BH_BIT(4),
- Block_Rule_Normal = Block_Rule_New_Scope | Block_Rule_Clear_Defer,
+ Block_Rule_Normal = Block_Rule_New_Scope | Block_Rule_Clear_Defer | Block_Rule_Emit_Instructions,
Block_Rule_Macro = Block_Rule_New_Scope,
Block_Rule_Code_Block = Block_Rule_New_Scope,
- Block_Rule_Do_Block = Block_Rule_New_Scope | Block_Rule_Clear_Defer | Block_Rule_Override_Return,
+ Block_Rule_Do_Block = Block_Rule_New_Scope | Block_Rule_Clear_Defer | Block_Rule_Override_Return | Block_Rule_Emit_Instructions,
} BlockRule;
typedef struct Arguments Arguments;
@Hack // This whole situtation is a hack of trying to a pointer to a valid state.
if state == null {
- state = map.get_ptr(^workspace_states, hash);
-
- if state == null {
+ if state = map.get_ptr(^workspace_states, hash); state == null {
map.put(^workspace_states, hash, .{});
state = map.get_ptr(^workspace_states, hash);
}
}
}
- mx, my := get_mouse_position();
- if Rectangle.contains(r, mx, my) {
+ if mx, my := get_mouse_position();
+ Rectangle.contains(r, mx, my) {
set_hot_item(hash);
}
EMIT_FUNC(block, AstBlock* block, b32 generate_block_headers) {
bh_arr(WasmInstruction) code = *pcode;
- generate_block_headers = generate_block_headers && (block->rules & Block_Rule_New_Scope);
+ generate_block_headers = generate_block_headers && (block->rules & Block_Rule_Emit_Instructions);
if (generate_block_headers) {
emit_enter_structured_block(mod, &code, (block->rules & Block_Rule_Override_Return)