| 477 | } // namespace common_internal |
| 478 | |
| 479 | absl::optional<SourceLocation> Source::GetLocation( |
| 480 | SourcePosition position) const { |
| 481 | if (auto line_and_offset = FindLine(position); |
| 482 | ABSL_PREDICT_TRUE(line_and_offset.has_value())) { |
| 483 | return SourceLocation{line_and_offset->first, |
| 484 | position - line_and_offset->second}; |
| 485 | } |
| 486 | return absl::nullopt; |
| 487 | } |
| 488 | |
| 489 | absl::optional<SourcePosition> Source::GetPosition( |
| 490 | const SourceLocation& location) const { |