(parser: P)
| 140 | } |
| 141 | |
| 142 | fn with_doc_comment<'a, I, P, O>(parser: P) -> impl Parser<'a, I, O, ParserError<'a>> + Clone + 'a |
| 143 | where |
| 144 | I: Input<'a, Token = lr::Token, Span = Span> + BorrowInput<'a>, |
| 145 | P: Parser<'a, I, O, ParserError<'a>> + Clone + 'a, |
| 146 | O: SupportsDocComment + 'a, |
| 147 | { |
| 148 | doc_comment() |
| 149 | .or_not() |
| 150 | .then(parser) |
| 151 | .map(|(doc_comment, inner)| inner.with_doc_comment(doc_comment)) |
| 152 | } |
| 153 | |
| 154 | /// Allows us to surround a parser by `with_doc_comment` and for a doc comment |
| 155 | /// to be added to the result, as long as the result implements `SupportsDocComment`. |
no test coverage detected