| 1500 | } |
| 1501 | |
| 1502 | std::string ParserVisitor::ExtractQualifiedName(antlr4::ParserRuleContext* ctx, |
| 1503 | const Expr& e) { |
| 1504 | if (e == Expr{}) { |
| 1505 | return ""; |
| 1506 | } |
| 1507 | |
| 1508 | if (const auto* ident_expr = absl::get_if<IdentExpr>(&e.kind()); ident_expr) { |
| 1509 | return ident_expr->name(); |
| 1510 | } |
| 1511 | if (const auto* select_expr = absl::get_if<SelectExpr>(&e.kind()); |
| 1512 | select_expr) { |
| 1513 | std::string prefix = ExtractQualifiedName(ctx, select_expr->operand()); |
| 1514 | if (!prefix.empty()) { |
| 1515 | return absl::StrCat(prefix, ".", select_expr->field()); |
| 1516 | } |
| 1517 | } |
| 1518 | factory_.ReportError(factory_.GetSourceRange(e.id()), |
| 1519 | "expected a qualified name"); |
| 1520 | return ""; |
| 1521 | } |
| 1522 | |
| 1523 | // Replacements for absl::StrReplaceAll for escaping standard whitespace |
| 1524 | // characters. |
nothing calls this directly
no test coverage detected