From: Lukas Krickl Date: Tue, 28 Nov 2023 05:10:00 +0000 (+0100) Subject: WIP: label scoping X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=9ad4af46a35955fc135121d2a8df98c357ccf259;p=ulas%2F.git WIP: label scoping --- diff --git a/include/ulas.h b/include/ulas.h index d26dab2..ed38f4a 100644 --- a/include/ulas.h +++ b/include/ulas.h @@ -158,6 +158,8 @@ struct ulas_sym { char *name; struct ulas_tok tok; enum ulas_syms type; + // this label's scope index + int scope; }; // holds all currently defned symbols @@ -193,6 +195,10 @@ struct ulas { unsigned int address; + // current scope index + // each global-label increments the scope + int scope; + // internal counter // used whenever a new unique number might be needed int icntr;