feat(joinir): Phase 245C - Function parameter capture + test fix
Extend CapturedEnv to include function parameters used in loop conditions, enabling ExprLowerer to resolve variables like `s` in `loop(p < s.length())`. Phase 245C changes: - function_scope_capture.rs: Add collect_names_in_loop_parts() helper - function_scope_capture.rs: Extend analyze_captured_vars_v2() with param capture logic - function_scope_capture.rs: Add 4 new comprehensive tests Test fix: - expr_lowerer/ast_support.rs: Accept all MethodCall nodes for syntax support (validation happens during lowering in MethodCallLowerer) Problem solved: "Variable not found: s" errors in loop conditions Test results: 924/924 PASS (+13 from baseline 911) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -23,6 +23,7 @@ impl MirBuilder {
|
||||
///
|
||||
/// Phase 195: Delegates to JoinLoopTrace for unified tracing.
|
||||
/// Enable with NYASH_TRACE_VARMAP=1
|
||||
#[allow(dead_code)]
|
||||
pub(in crate::mir::builder) fn trace_varmap(&self, context: &str) {
|
||||
super::joinir::trace::trace().varmap(context, &self.variable_map);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user