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

Function new_line

prqlc/prqlc-parser/src/parser/mod.rs:94–103  ·  view source on GitHub ↗

Our approach to new lines is each item consumes new lines _before_ itself, but not newlines after itself. This allows us to enforce new lines between some items. The only place we handle new lines after an item is in the root parser.

()

Source from the content-addressed store, hash-verified

92/// some items. The only place we handle new lines after an item is in the root
93/// parser.
94pub(crate) fn new_line<'a, I>() -> impl Parser<'a, I, (), ParserError<'a>> + Clone
95where
96 I: Input<'a, Token = lr::Token, Span = Span> + BorrowInput<'a>,
97{
98 select_ref! {
99 lr::Token { kind: TokenKind::NewLine, .. } => (),
100 lr::Token { kind: TokenKind::Start, .. } => (),
101 }
102 .labelled("new line")
103}
104
105fn ctrl<'a, I>(char: char) -> impl Parser<'a, I, (), ParserError<'a>> + Clone
106where

Callers 11

sourceFunction · 0.85
module_contentsFunction · 0.85
query_defFunction · 0.85
var_defFunction · 0.85
doc_commentFunction · 0.85
sequenceFunction · 0.85
pipeFunction · 0.85
parse_doc_commentFunction · 0.85
type_exprFunction · 0.85
exprFunction · 0.85
lambda_funcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected