(expr ast.Expr, nested bool)
| 456 | } |
| 457 | |
| 458 | func (un *unparser) visitMaybeNested(expr ast.Expr, nested bool) error { |
| 459 | if nested { |
| 460 | un.str.WriteString("(") |
| 461 | } |
| 462 | err := un.visit(expr) |
| 463 | if err != nil { |
| 464 | return err |
| 465 | } |
| 466 | if nested { |
| 467 | un.str.WriteString(")") |
| 468 | } |
| 469 | return nil |
| 470 | } |
| 471 | |
| 472 | // isLeftRecursive indicates whether the parser resolves the call in a left-recursive manner as |
| 473 | // this can have an effect of how parentheses affect the order of operations in the AST. |
no test coverage detected