MCPcopy Create free account
hub / github.com/PRQL/prql / with_doc_comment

Function with_doc_comment

prqlc/prqlc-parser/src/parser/mod.rs:142–152  ·  view source on GitHub ↗
(parser: P)

Source from the content-addressed store, hash-verified

140}
141
142fn with_doc_comment<'a, I, P, O>(parser: P) -> impl Parser<'a, I, O, ParserError<'a>> + Clone + 'a
143where
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`.

Callers 4

sourceFunction · 0.85
module_contentsFunction · 0.85
exprFunction · 0.85
pipelineFunction · 0.85

Calls 3

mapMethod · 0.80
doc_commentFunction · 0.70
with_doc_commentMethod · 0.45

Tested by

no test coverage detected