diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-28 16:01:10 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-28 16:01:10 +0200 |
| commit | 075bc33d15b4d11fa03f381c3e03437d9f759c22 (patch) | |
| tree | 67f65db39e0f89b36f5a38189eb4a6245eab65a4 /src/build.h | |
| parent | 952357132060dd874fc550d35e0e4f8bc61efd87 (diff) | |
Refactor _process() by extracting per-operator handler functions [SRP]
_process() was a 510-line function with a nested switch(operator) x
switch(type) structure. Extracted 17 static helper functions:
- _resolve_composite_op(): maps two-token operator pairs (!=, ==, <=,
>=, <<, >>) to their canonical single TokenType
- _op_assign(): handles variable and array-element assignment
- _op_add(), _op_sub(), _op_mult(), _op_div(): arithmetic operators
- _op_eq(), _op_neq(), _op_lt(), _op_gt(), _op_le(), _op_ge():
comparison operators (result always TT_INTEGER)
- _op_and(), _op_or(), _op_xor(), _op_lshift(), _op_rshift():
bitwise operators (doubles/strings coerced to int)
_process() is now a ~70-line dispatcher. Assignment is guarded by
`else if` so it only fires when p_token_op2 == NULL, preserving the
original semantics exactly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/build.h')
| -rw-r--r-- | src/build.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/build.h b/src/build.h index 161c8f2..ab16e44 100644 --- a/src/build.h +++ b/src/build.h @@ -36,7 +36,7 @@ #ifndef BUILD_H #define BUILD_H -#define BUILDNR 9689 +#define BUILDNR 9696 #define OS_LINUX #endif |
