| 695 | }; |
| 696 | |
| 697 | PathInfo Fixup(PathInfo info) { |
| 698 | // We only need to fixup the path if there were repeated |
| 699 | // elements on it. |
| 700 | if (info.max_rep_level == 0) { |
| 701 | return info; |
| 702 | } |
| 703 | FixupVisitor visitor; |
| 704 | visitor.max_rep_level = info.max_rep_level; |
| 705 | if (visitor.max_rep_level > 0) { |
| 706 | visitor.rep_level_if_null = 0; |
| 707 | } |
| 708 | for (size_t x = 0; x < info.path.size(); x++) { |
| 709 | std::visit(visitor, info.path[x]); |
| 710 | } |
| 711 | return info; |
| 712 | } |
| 713 | |
| 714 | class PathBuilder { |
| 715 | public: |