Format formats the node.
(buf *nodeBuffer)
| 2477 | |
| 2478 | // Format formats the node. |
| 2479 | func (node *FuncExpr) Format(buf *nodeBuffer) { |
| 2480 | var distinct string |
| 2481 | if node.Distinct { |
| 2482 | distinct = "distinct " |
| 2483 | } |
| 2484 | if !node.Qualifier.IsEmpty() { |
| 2485 | buf.Printf("%v.", node.Qualifier) |
| 2486 | } |
| 2487 | // Function names should not be back-quoted even |
| 2488 | // if they match a reserved word. So, print the |
| 2489 | // name as is. |
| 2490 | buf.Printf("%s(%s%v)", node.Name.Name, distinct, node.Exprs) |
| 2491 | if len(node.WithinGroup) > 0 { |
| 2492 | buf.Printf(" within group(") |
| 2493 | node.WithinGroup.Format(buf) |
| 2494 | buf.Printf(")") |
| 2495 | } |
| 2496 | buf.Printf("%v", node.Over) |
| 2497 | } |
| 2498 | |
| 2499 | // FuncCallExpr represents a function call that takes Exprs. |
| 2500 | type FuncCallExpr struct { |