feat: FiveSql2 43/43, @byref, mutable closure, RTL 479, DateTime fix

Major changes since last commit:
- FiveSql2 SQL:1999 engine (10,458 LOC) — 43/43 ALL PASS
- 21 compiler/runtime bugs fixed (short-circuit AND/OR, FOR LOOP, etc.)
- @byref pass-by-reference via RefCell pattern
- Mutable closure capture (EnsureLocalRef + RefCell sharing)
- RTL: 400 → 479 functions (+79: file, string, datetime, hash, UTF-8)
- DateTime/Timestamp fully working (hb_DateTime, hb_Hour/Min/Sec, display)
- Reserved word guard (39 keywords blocked from function calls)
- AEval arg order fix (element before index)
- Closure capture redecl fix (unique _cap_ names per block)
- Hash/string indexing in ArrayPush/ArrayPop
- Harbour compat test suite: 51/51
- 4 docs: Porting Report, Implementation Plan, Optimization Plan, Commercialization

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-11 11:35:37 +09:00
parent d451b836a6
commit 486e466592
129 changed files with 35248 additions and 241 deletions

View File

@@ -187,8 +187,10 @@ func AEval(t *hbrt.Thread) {
blk := blkVal.AsBlock()
for i, item := range arr.Items {
t.PushValue(item)
t.PushValue(hbrt.MakeInt(i + 1)) // 1-based index
// Harbour: AEval callback receives (element, index).
// Stack order: index first, element on top — Frame picks top-N.
t.PushValue(hbrt.MakeInt(i + 1)) // arg2: 1-based index
t.PushValue(item) // arg1: element value
t.PendingParams2(2)
blk.Fn(t)
}