From 61a68ed4d7315dd6cacd4a89174b55deebd05ec6 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Tue, 3 Dec 2024 21:14:49 -0800 Subject: [PATCH] add additional comments to emit prog --- src/core/chuck_emit.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/chuck_emit.cpp b/src/core/chuck_emit.cpp index e719c45d4..61c9554b9 100644 --- a/src/core/chuck_emit.cpp +++ b/src/core/chuck_emit.cpp @@ -210,6 +210,9 @@ Chuck_VM_Code * emit_engine_emit_prog( Chuck_Emitter * emit, a_Program prog, // for separating out function defs and class defs | 1.5.4.4 (ge) added // this is to re-order code emission by stmt_lists -> func defs -> class defs + // ensures that local (file-scope) variables have a chance to acquire a stack offset + // before their use from functions and classes -- even if the local var declaration + // appears after the function or class definintion vector func_defs; vector class_defs; @@ -254,14 +257,14 @@ Chuck_VM_Code * emit_engine_emit_prog( Chuck_Emitter * emit, a_Program prog, prog = prog->next; } - // iterate over func defs, as long as `ret` is true + // iterate over func defs, as long as `ret` is true | 1.5.4.4 (ge) moved out to here for( size_t i = 0; ret && (i