feat(joinir): Phase 248 - Normalized JoinIR infrastructure
Major refactoring of JoinIR normalization pipeline: Key changes: - Structured→Normalized→MIR(direct) pipeline established - ShapeGuard enhanced with Pattern2 loop validation - dev_env.rs: New development fixtures and env control - fixtures.rs: jsonparser_parse_number_real fixture - normalized_bridge/direct.rs: Direct MIR generation from Normalized - pattern2_step_schedule.rs: Extracted step scheduling logic Files changed: - normalized.rs: Enhanced NormalizedJoinModule with DevEnv support - shape_guard.rs: Pattern2-specific validation (+300 lines) - normalized_bridge.rs: Unified bridge with direct path - loop_with_break_minimal.rs: Integrated step scheduling - Deleted: step_schedule.rs (moved to pattern2_step_schedule.rs) New files: - param_guess.rs: Loop parameter inference - pattern2_step_schedule.rs: Step scheduling for Pattern2 - phase43-norm-canon-p2-mid.md: Design doc Tests: 937/937 PASS (+6 from baseline 931) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -52,24 +52,25 @@ enum FunctionRoute {
|
||||
}
|
||||
|
||||
fn resolve_function_route(func_name: &str) -> Result<FunctionRoute, String> {
|
||||
const IF_RETURN_NAMES: &[&str] = &["test", "local", "_read_value_from_pair"];
|
||||
const LOOP_NAMES: &[&str] = &[
|
||||
"simple",
|
||||
"filter",
|
||||
"print_tokens",
|
||||
"map",
|
||||
"reduce",
|
||||
"fold",
|
||||
"jsonparser_skip_ws_mini",
|
||||
"jsonparser_atoi_mini",
|
||||
const TABLE: &[(&str, FunctionRoute)] = &[
|
||||
("test", FunctionRoute::IfReturn),
|
||||
("local", FunctionRoute::IfReturn),
|
||||
("_read_value_from_pair", FunctionRoute::IfReturn),
|
||||
("simple", FunctionRoute::LoopFrontend),
|
||||
("filter", FunctionRoute::LoopFrontend),
|
||||
("print_tokens", FunctionRoute::LoopFrontend),
|
||||
("map", FunctionRoute::LoopFrontend),
|
||||
("reduce", FunctionRoute::LoopFrontend),
|
||||
("fold", FunctionRoute::LoopFrontend),
|
||||
("jsonparser_skip_ws_mini", FunctionRoute::LoopFrontend),
|
||||
("jsonparser_skip_ws_real", FunctionRoute::LoopFrontend),
|
||||
("jsonparser_atoi_mini", FunctionRoute::LoopFrontend),
|
||||
("jsonparser_atoi_real", FunctionRoute::LoopFrontend),
|
||||
("jsonparser_parse_number_real", FunctionRoute::LoopFrontend),
|
||||
];
|
||||
|
||||
if IF_RETURN_NAMES.contains(&func_name) {
|
||||
return Ok(FunctionRoute::IfReturn);
|
||||
}
|
||||
|
||||
if LOOP_NAMES.contains(&func_name) {
|
||||
return Ok(FunctionRoute::LoopFrontend);
|
||||
if let Some((_, route)) = TABLE.iter().find(|(name, _)| *name == func_name) {
|
||||
return Ok(*route);
|
||||
}
|
||||
|
||||
if func_name == "parse_loop" {
|
||||
|
||||
Reference in New Issue
Block a user