diff --git a/normalisealts.go b/normalisealts.go index d31533c..2c2dbf6 100644 --- a/normalisealts.go +++ b/normalisealts.go @@ -35,6 +35,34 @@ func normaliseAltCb(n_ *node.Node) error { *n_ = elifStmt + case *stmt.AltFor: + forStmt := stmt.NewFor(n.Init, n.Cond, n.Loop, n.Stmt) + forStmt.FreeFloating = n.FreeFloating + forStmt.Position = n.Position + + *n_ = forStmt + + case *stmt.AltForeach: + feStmt := stmt.NewForeach(n.Expr, n.Key, n.Variable, n.Stmt) + feStmt.FreeFloating = n.FreeFloating + feStmt.Position = n.Position + + *n_ = feStmt + + case *stmt.AltSwitch: + swStmt := stmt.NewSwitch(n.Cond, n.CaseList) + swStmt.FreeFloating = n.FreeFloating + swStmt.Position = n.Position + + *n_ = swStmt + + case *stmt.AltWhile: + wStmt := stmt.NewWhile(n.Cond, n.Stmt) + wStmt.FreeFloating = n.FreeFloating + wStmt.Position = n.Position + + *n_ = wStmt + default: // no change }