(node ast.Node)
| 559 | } |
| 560 | |
| 561 | func dmlNodeLoc(node ast.Node) ast.Loc { |
| 562 | if common.IsNil(node) { |
| 563 | return ast.NoLoc() |
| 564 | } |
| 565 | switch n := node.(type) { |
| 566 | case *ast.UpdateStmt: |
| 567 | return n.Loc |
| 568 | case *ast.DeleteStmt: |
| 569 | return n.Loc |
| 570 | case *ast.TopClause: |
| 571 | return n.Loc |
| 572 | case *ast.TableRef: |
| 573 | return n.Loc |
| 574 | case *ast.TableVarRef: |
| 575 | return n.Loc |
| 576 | case *ast.TableVarMethodCallRef: |
| 577 | return n.Loc |
| 578 | case *ast.AliasedTableRef: |
| 579 | return n.Loc |
| 580 | case *ast.JoinClause: |
| 581 | loc := n.Loc |
| 582 | leftLoc := dmlNodeLoc(n.Left) |
| 583 | if leftLoc.Start >= 0 && (loc.Start < 0 || leftLoc.Start < loc.Start) { |
| 584 | loc.Start = leftLoc.Start |
| 585 | } |
| 586 | return loc |
| 587 | case *ast.SetExpr: |
| 588 | return n.Loc |
| 589 | default: |
| 590 | loc := omniNodeLoc(node) |
| 591 | if loc.Start >= 0 { |
| 592 | return loc |
| 593 | } |
| 594 | return ast.NoLoc() |
| 595 | } |
| 596 | } |
no test coverage detected