(n node.Node)
| 1508 | } |
| 1509 | |
| 1510 | func (p *PrettyPrinter) printStmtClassMethod(n node.Node) { |
| 1511 | nn := n.(*stmt.ClassMethod) |
| 1512 | |
| 1513 | if nn.Modifiers != nil { |
| 1514 | p.joinPrint(" ", nn.Modifiers) |
| 1515 | io.WriteString(p.w, " ") |
| 1516 | } |
| 1517 | io.WriteString(p.w, "function ") |
| 1518 | |
| 1519 | if nn.ReturnsRef { |
| 1520 | io.WriteString(p.w, "&") |
| 1521 | } |
| 1522 | |
| 1523 | p.Print(nn.MethodName) |
| 1524 | io.WriteString(p.w, "(") |
| 1525 | p.joinPrint(", ", nn.Params) |
| 1526 | io.WriteString(p.w, ")") |
| 1527 | |
| 1528 | if nn.ReturnType != nil { |
| 1529 | io.WriteString(p.w, ": ") |
| 1530 | p.Print(nn.ReturnType) |
| 1531 | } |
| 1532 | |
| 1533 | switch s := nn.Stmt.(type) { |
| 1534 | case *stmt.StmtList: |
| 1535 | io.WriteString(p.w, "\n") |
| 1536 | p.printIndent() |
| 1537 | io.WriteString(p.w, "{\n") |
| 1538 | p.printNodes(s.Stmts) |
| 1539 | io.WriteString(p.w, "\n") |
| 1540 | p.printIndent() |
| 1541 | io.WriteString(p.w, "}") |
| 1542 | default: |
| 1543 | p.Print(s) |
| 1544 | } |
| 1545 | } |
| 1546 | |
| 1547 | func (p *PrettyPrinter) printStmtClass(n node.Node) { |
| 1548 | nn := n.(*stmt.Class) |
no test coverage detected