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

Function insert_start

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

Insert a start token so later stages can treat the start of a file like a newline

(tokens: Vec<Token>)

Source from the content-addressed store, hash-verified

101
102/// Insert a start token so later stages can treat the start of a file like a newline
103fn insert_start(tokens: Vec<Token>) -> Vec<Token> {
104 std::iter::once(Token {
105 kind: TokenKind::Start,
106 span: 0..0,
107 })
108 .chain(tokens)
109 .collect()
110}
111
112/// Lex chars to tokens until the end of the input
113pub fn lexer<'a>() -> impl Parser<'a, ParserInput<'a>, Vec<Token>, ParserError<'a>> {

Callers 2

lex_source_recoveryFunction · 0.85
lex_sourceFunction · 0.85

Calls 1

collectMethod · 0.45

Tested by

no test coverage detected