MCPcopy Create free account
hub / github.com/z7zmey/php-parser / printStmtAltFor

Method printStmtAltFor

printer/printer.go:1965–1996  ·  view source on GitHub ↗
(n node.Node)

Source from the content-addressed store, hash-verified

1963}
1964
1965func (p *Printer) printStmtAltFor(n node.Node) {
1966 nn := n.(*stmt.AltFor)
1967 p.printFreeFloating(nn, freefloating.Start)
1968
1969 io.WriteString(p.w, "for")
1970 p.printFreeFloating(nn, freefloating.For)
1971 io.WriteString(p.w, "(")
1972 p.joinPrint(",", nn.Init)
1973 p.printFreeFloating(nn, freefloating.InitExpr)
1974 io.WriteString(p.w, ";")
1975 p.joinPrint(",", nn.Cond)
1976 p.printFreeFloating(nn, freefloating.CondExpr)
1977 io.WriteString(p.w, ";")
1978 p.joinPrint(",", nn.Loop)
1979 p.printFreeFloating(nn, freefloating.IncExpr)
1980 io.WriteString(p.w, ")")
1981 p.printFreeFloating(nn, freefloating.Cond)
1982 io.WriteString(p.w, ":")
1983
1984 s := nn.Stmt.(*stmt.StmtList)
1985 p.printNodes(s.Stmts)
1986 p.printFreeFloating(nn, freefloating.Stmts)
1987
1988 io.WriteString(p.w, "endfor")
1989 p.printFreeFloating(nn, freefloating.AltEnd)
1990 p.printFreeFloating(nn, freefloating.SemiColon)
1991 if nn.GetFreeFloating().IsEmpty() {
1992 io.WriteString(p.w, ";")
1993 }
1994
1995 p.printFreeFloating(nn, freefloating.End)
1996}
1997
1998func (p *Printer) printStmtAltForeach(n node.Node) {
1999 nn := n.(*stmt.AltForeach)

Callers 1

printNodeMethod · 0.95

Calls 5

printFreeFloatingMethod · 0.95
joinPrintMethod · 0.95
printNodesMethod · 0.95
IsEmptyMethod · 0.80
GetFreeFloatingMethod · 0.65

Tested by

no test coverage detected