pub fn parse_program_tree_in(
src: &str,
pack: &Yakugo,
) -> Result<Vec<Spanned>, ParseError>Expand description
parse_program_in keeping every node’s source span.
The same relation parse_program_tree has to parse_program, and it
exists for the same reason: a surface is a spelling, so a program written in
one has positions exactly as real as an English-surface program’s. Without
this door, pipeline::run_in_surface would have to lift a spanless tree back
up and every type error in a yakugo program would report <synthetic> —
a position the parser HAD and threw away one line earlier, which is the
class Diagnostic::span’s own docs name.
parse_program_in is now its projection, so the two cannot drift.
§Errors
As parse_program_in.