Files
hakorune/lang/src/compiler/parser
nyash-codex 82cdfa7056 feat(selfhost): Add Stage-3 LOCAL keyword support to ParserStmtBox
🔧 Problem: Selfhost ParserBox doesn't recognize LOCAL keyword
   - Only supports lowercase 'local' (Stage-1/2)
   - Stage-3 mode with HAKO_PARSER_STAGE3=1 not working

 Solution: Add LOCAL keyword recognition in ParserStmtBox
   - Check ctx.stage3_enabled() before parsing
   - Support both 'local' and 'LOCAL' keywords
   - Maintain backward compatibility with Stage-1/2

📍 Modified: lang/src/compiler/parser/stmt/parser_stmt_box.hako:109-149
   - Added is_local_kw flag and kw_len variable
   - Check 'local' first (always)
   - Check 'LOCAL' if stage3_enabled() (conditional)

🐛 Current status:
   - Using-chain parsing:  SUCCESS (2 files)
   - Stage-B test:  Still failing with 'Unexpected token LOCAL at line 19'
   - Next: Investigate which file's line 19 is causing the error

Related: #stageb-緑化 #phase-20.33 #selfhost-parser
2025-11-01 21:52:53 +09:00
..