Skip to main content

parse_and_exec

Function parse_and_exec 

Source
pub fn parse_and_exec(ctx: &mut Context, source: &[u8]) -> Result<(), PsError>
Expand description

Tokenize a byte stream and execute it.

Creates a file-backed source in the FileStore and pushes it as an executable File on the exec stack. The eval loop tokenizes and executes one token at a time, ensuring //name immediate lookups see earlier definitions and ALL errors route through errordict.

Using a File (not an executable string) means currentfile can find the source — this is correct for top-level execution of PS files.