Skip to main content

parse_program_in

Function parse_program_in 

Source
pub fn parse_program_in(
    src: &str,
    pack: &Yakugo,
) -> Result<Vec<Sexp>, ParseError>
Expand description

Parse a program written in a Yakugo surface.

The pack is applied to the TOKEN STREAM, between lexing and parsing, so the parser below is untouched and every keyword site works by construction. What comes out is the same Sexp the English surface produces — that is the invariant the pack tests assert, and the only thing that makes a surface a surface rather than a dialect.

§Errors

Lex and parse errors propagate unchanged. A pack cannot repair source that does not tokenize, and reporting otherwise would name the wrong problem.