Skip to main content

parse_polydat

Function parse_polydat 

Source
pub fn parse_polydat(source: &str) -> Result<PolydatFile, KernelError>
Expand description

Parse Polydat source into the program tree, the form every transform reads and rewrites.

This is the first of the three steps a host takes when it shapes a program before running it: parse, transform, compile. A host with nothing to change calls a compile_polydat* entry point instead and never sees a tree; a host that injects a value (transform::assign_values), adds tiles it built from what it holds (transform::add_tiles), or rewrites a definition in place applies as many of those as it means to the one tree and compiles it once with compile_ast_with_engine or compile_ast_interpreter_with_options.

parse_polydat_with_tile_defaults is the same parse for a host that sets the hole delimiters a tile body is read with.