cpclib_asm::parser

Function parse_z80_with_context_builder

Source
pub fn parse_z80_with_context_builder<S: Into<String>>(
    str: S,
    builder: ParserContextBuilder,
) -> Result<LocatedListing, AssemblerError>
Expand description

Produce the stream of tokens. In case of error, return an explanatory string. In case of success loop over all the tokens in order to expand those that read files

Examples found in repository?
examples/generate_loop4000.rs (line 7)
5
6
7
8
9
10
11
12
13
fn build_sna(code: &str) -> Snapshot {
    let listing =
        parse_z80_with_context_builder(code, Default::default()).expect("Unable to parse z80 code");
    let (_, env) = visit_tokens_all_passes_with_options(&listing, Default::default())
        .expect("Unable to assemble z80 code");
    let sna = env.sna().clone();

    sna
}