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

Method printExprYield

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

Source from the content-addressed store, hash-verified

1902}
1903
1904func (p *Printer) printExprYield(n node.Node) {
1905 nn := n.(*expr.Yield)
1906 p.printFreeFloating(nn, freefloating.Start)
1907
1908 io.WriteString(p.w, "yield")
1909
1910 if nn.Key != nil {
1911 if nn.Key.GetFreeFloating().IsEmpty() {
1912 io.WriteString(p.w, " ")
1913 }
1914 p.Print(nn.Key)
1915 p.printFreeFloating(nn, freefloating.Expr)
1916 io.WriteString(p.w, "=>")
1917 } else {
1918 if nn.Value.GetFreeFloating().IsEmpty() {
1919 io.WriteString(p.w, " ")
1920 }
1921 }
1922
1923 p.Print(nn.Value)
1924
1925 p.printFreeFloating(nn, freefloating.End)
1926}
1927
1928// smtm
1929

Callers 1

printNodeMethod · 0.95

Calls 4

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

Tested by

no test coverage detected