| 5857 | operator. */ |
| 5858 | template<typename ParserType2> |
| 5859 | constexpr auto |
| 5860 | operator||(parser_interface<ParserType2> rhs) const noexcept |
| 5861 | { |
| 5862 | // If you're seeing this as a compile- or run-time failure, you've |
| 5863 | // tried to put an eps parser in a permutation-parser, such as |
| 5864 | // "eps || int_". |
| 5865 | BOOST_PARSER_ASSERT(!detail::is_eps_p<parser_type>{}); |
| 5866 | BOOST_PARSER_ASSERT(!detail::is_eps_p<ParserType2>{}); |
| 5867 | if constexpr (detail::is_perm_p<parser_type>{}) { |
| 5868 | return parser_.append(rhs); |
| 5869 | } else if constexpr (detail::is_perm_p<ParserType2>{}) { |
| 5870 | return rhs.parser_.prepend(*this); |
| 5871 | } else { |
| 5872 | return parser::parser_interface{ |
| 5873 | perm_parser<tuple<parser_type, ParserType2>, detail::nope>{ |
| 5874 | tuple<parser_type, ParserType2>{parser_, rhs.parser_}}}; |
| 5875 | } |
| 5876 | } |
| 5877 | |
| 5878 | /** Returns a `parser_interface` containing a parser equivalent to an |
| 5879 | `or_parser` containing `parser_` followed by `lit(rhs)`. */ |