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

Method printStmtAltWhile

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

Source from the content-addressed store, hash-verified

2108}
2109
2110func (p *Printer) printStmtAltWhile(n node.Node) {
2111 nn := n.(*stmt.AltWhile)
2112 p.printFreeFloating(nn, freefloating.Start)
2113
2114 io.WriteString(p.w, "while")
2115 p.printFreeFloating(nn, freefloating.While)
2116 io.WriteString(p.w, "(")
2117 p.Print(nn.Cond)
2118 p.printFreeFloating(nn, freefloating.Expr)
2119 io.WriteString(p.w, ")")
2120 p.printFreeFloating(nn, freefloating.Cond)
2121 io.WriteString(p.w, ":")
2122
2123 s := nn.Stmt.(*stmt.StmtList)
2124 p.printNodes(s.Stmts)
2125 p.printFreeFloating(nn, freefloating.Stmts)
2126
2127 io.WriteString(p.w, "endwhile")
2128 p.printFreeFloating(nn, freefloating.AltEnd)
2129 p.printFreeFloating(nn, freefloating.SemiColon)
2130 if nn.GetFreeFloating().IsEmpty() {
2131 io.WriteString(p.w, ";")
2132 }
2133
2134 p.printFreeFloating(nn, freefloating.End)
2135}
2136
2137func (p *Printer) printStmtBreak(n node.Node) {
2138 nn := n.(*stmt.Break)

Callers 1

printNodeMethod · 0.95

Calls 5

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

Tested by

no test coverage detected