Jai_Lexer module

set_input_from_file

procedureSource

Reads the file at file_path and lexes it. Returns false if it cannot be read. The lexer frees the text when it is given new input.

set_input_from_file :: (lexer: *J.Lexer, file_path: string) -> bool

Parameters

lexer: *J.Lexer
file_path: string

Returns

bool
Example
lexer: Lexer;
assert(!set_input_from_file(*lexer, "no/such/file.jai"));

Doesn't run in the browser (skipped on wasm).

See also