MCPcopy Create free account
hub / github.com/LFDT-Nightstream/Starstream / parser

Function parser

starstream-compiler/src/parser/program.rs:9–24  ·  view source on GitHub ↗

Get a parser for a Starstream source file.

()

Source from the content-addressed store, hash-verified

7
8/// Get a parser for a Starstream source file.
9pub fn parser<'a>() -> impl Parser<'a, &'a str, Program, Extra<'a>> {
10 comment::shebang()
11 .or_not()
12 .then(
13 definition()
14 .spanned()
15 .padded()
16 .repeated()
17 .collect::<Vec<_>>(),
18 )
19 .then_ignore(end())
20 .map(|(shebang, definitions)| Program {
21 shebang,
22 definitions,
23 })
24}
25
26// NOTE: The test cases for the root program parser are included in the
27// compiler integration tests, rather than separated out here.

Callers 1

statementFunction · 0.70

Calls 3

shebangFunction · 0.85
mapMethod · 0.80
spannedMethod · 0.80

Tested by

no test coverage detected