(node oracleast.Node)
| 352 | } |
| 353 | |
| 354 | func oracleNodeLoc(node oracleast.Node) (oracleast.Loc, bool) { |
| 355 | if node == nil { |
| 356 | return oracleast.Loc{}, false |
| 357 | } |
| 358 | value := reflect.ValueOf(node) |
| 359 | if value.Kind() != reflect.Pointer || value.IsNil() { |
| 360 | return oracleast.Loc{}, false |
| 361 | } |
| 362 | elem := value.Elem() |
| 363 | if elem.Kind() != reflect.Struct { |
| 364 | return oracleast.Loc{}, false |
| 365 | } |
| 366 | field := elem.FieldByName("Loc") |
| 367 | if !field.IsValid() || field.Type() != reflect.TypeOf(oracleast.Loc{}) { |
| 368 | return oracleast.Loc{}, false |
| 369 | } |
| 370 | loc, ok := field.Interface().(oracleast.Loc) |
| 371 | if !ok || loc.End <= loc.Start { |
| 372 | return oracleast.Loc{}, false |
| 373 | } |
| 374 | return loc, true |
| 375 | } |
| 376 | |
| 377 | func oracleLocText(sql string, start, end int) string { |
| 378 | if start < 0 { |
no test coverage detected