(n node.Node)
| 2632 | } |
| 2633 | |
| 2634 | func (p *Printer) printStmtFunction(n node.Node) { |
| 2635 | nn := n.(*stmt.Function) |
| 2636 | p.printFreeFloating(nn, freefloating.Start) |
| 2637 | |
| 2638 | io.WriteString(p.w, "function") |
| 2639 | p.printFreeFloating(nn, freefloating.Function) |
| 2640 | |
| 2641 | if nn.ReturnsRef { |
| 2642 | if nn.GetFreeFloating().IsEmpty() { |
| 2643 | io.WriteString(p.w, " ") |
| 2644 | } |
| 2645 | io.WriteString(p.w, "&") |
| 2646 | } else { |
| 2647 | if nn.FunctionName.GetFreeFloating().IsEmpty() { |
| 2648 | io.WriteString(p.w, " ") |
| 2649 | } |
| 2650 | } |
| 2651 | |
| 2652 | p.Print(nn.FunctionName) |
| 2653 | p.printFreeFloating(nn, freefloating.Name) |
| 2654 | |
| 2655 | io.WriteString(p.w, "(") |
| 2656 | p.joinPrint(",", nn.Params) |
| 2657 | p.printFreeFloating(nn, freefloating.ParamList) |
| 2658 | io.WriteString(p.w, ")") |
| 2659 | p.printFreeFloating(nn, freefloating.Params) |
| 2660 | |
| 2661 | if nn.ReturnType != nil { |
| 2662 | io.WriteString(p.w, ":") |
| 2663 | p.Print(nn.ReturnType) |
| 2664 | } |
| 2665 | p.printFreeFloating(nn, freefloating.ReturnType) |
| 2666 | |
| 2667 | io.WriteString(p.w, "{") |
| 2668 | p.printNodes(nn.Stmts) |
| 2669 | p.printFreeFloating(nn, freefloating.Stmts) |
| 2670 | io.WriteString(p.w, "}") |
| 2671 | |
| 2672 | p.printFreeFloating(nn, freefloating.End) |
| 2673 | } |
| 2674 | |
| 2675 | func (p *Printer) printStmtGlobal(n node.Node) { |
| 2676 | nn := n.(*stmt.Global) |
no test coverage detected