refactor(normalization): Deprecate LoopWithPost variant
- Mark LoopWithPost enum variant as deprecated (Phase 142 P0) - Add deprecation to loop_with_post() constructor function - Document migration path to LoopOnly - Keep for backward compatibility until full migration Phase 142 P0: Statement-level normalization makes LoopWithPost obsolete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -26,8 +26,21 @@ pub enum PlanKind {
|
||||
|
||||
/// Phase 132-133: loop(true) + post assignments + return
|
||||
///
|
||||
/// **DEPRECATED in Phase 142 P0**: This variant is no longer created by PlanBox.
|
||||
/// Normalization unit changed from "block suffix" to "statement (loop only)".
|
||||
/// Post-loop assignments are now handled by normal MIR lowering, not normalization.
|
||||
///
|
||||
/// Migration: Use `LoopOnly` instead. Process subsequent statements separately.
|
||||
///
|
||||
/// This variant is kept for backward compatibility but will be removed
|
||||
/// once all match arms and tests migrate to statement-level normalization.
|
||||
///
|
||||
/// Pattern: loop + N assignments + return
|
||||
/// Example: `loop(true) { x = 1; break }; x = x + 2; return x`
|
||||
#[deprecated(
|
||||
since = "Phase 142 P0",
|
||||
note = "Use LoopOnly instead. Normalization unit is now statement-level."
|
||||
)]
|
||||
LoopWithPost {
|
||||
/// Number of post-loop assignment statements
|
||||
post_assign_count: usize,
|
||||
@ -45,6 +58,13 @@ impl NormalizationPlan {
|
||||
}
|
||||
|
||||
/// Create a Phase 132-133 plan (loop + post assignments + return)
|
||||
///
|
||||
/// **DEPRECATED in Phase 142 P0**: Use `loop_only()` instead.
|
||||
/// Statement-level normalization makes this obsolete.
|
||||
#[deprecated(
|
||||
since = "Phase 142 P0",
|
||||
note = "Use loop_only() instead. Statement-level normalization makes this obsolete."
|
||||
)]
|
||||
pub fn loop_with_post(post_assign_count: usize) -> Self {
|
||||
// consumed = 1 (loop) + N (assigns) + 1 (return)
|
||||
let consumed = 1 + post_assign_count + 1;
|
||||
|
||||
Reference in New Issue
Block a user