Skip to content

Commit 9ef5202

Browse files
Peter Neissclaude
andcommitted
Phase 122.6c: Rename expdesc local variable fields for clarity
Replaced abbreviated field names with verbose camelCase: - var.ridx → var.registerIndex (4 sites: 2 field + 2 accessor) - var.vidx → var.variableIndex (4 sites: 2 field + 2 accessor) Updated accessor method implementations: - getLocalRegister(), setLocalRegister() now use u.var.registerIndex - getLocalVarIndex(), setLocalVarIndex() now use u.var.variableIndex All implementation code uses accessor methods (perfect encapsulation), so no changes needed outside lparser.h. Changes: - lparser.h (expdesc class: var struct field declarations, accessor implementations) Performance: ~2.20s avg (5 runs) - excellent, well within ≤4.33s target Tests: All passing ✓ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 145cd90 commit 9ef5202

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/compiler/lparser.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class expdesc {
9191
int stringKeyIndex; /* index in 'k' of string key, or -1 if not a string */
9292
} ind;
9393
struct { /* for local variables */
94-
lu_byte ridx; /* register holding the variable */
95-
short vidx; /* index in 'actvar.arr' */
94+
lu_byte registerIndex; /* register holding the variable */
95+
short variableIndex; /* index in 'actvar.arr' */
9696
} var;
9797
} u;
9898
int t; /* patch list of 'exit when true' */
@@ -125,10 +125,10 @@ class expdesc {
125125
void setIndexedStringKeyIndex(int keystr) noexcept { u.ind.stringKeyIndex = keystr; }
126126

127127
// Local variable accessors (u.var)
128-
lu_byte getLocalRegister() const noexcept { return u.var.ridx; }
129-
void setLocalRegister(lu_byte ridx) noexcept { u.var.ridx = ridx; }
130-
short getLocalVarIndex() const noexcept { return u.var.vidx; }
131-
void setLocalVarIndex(short vidx) noexcept { u.var.vidx = vidx; }
128+
lu_byte getLocalRegister() const noexcept { return u.var.registerIndex; }
129+
void setLocalRegister(lu_byte ridx) noexcept { u.var.registerIndex = ridx; }
130+
short getLocalVarIndex() const noexcept { return u.var.variableIndex; }
131+
void setLocalVarIndex(short vidx) noexcept { u.var.variableIndex = vidx; }
132132

133133
// Patch lists
134134
int getTrueList() const noexcept { return t; }

0 commit comments

Comments
 (0)