Reduct  v4.0.5-1-g4851deb
A functional and immutable language.
Loading...
Searching...
No Matches
Parse

Detailed Description

Functions

REDUCT_API reduct_handle_t reduct_parse (reduct_t *reduct, const char *str, size_t len, const char *path)
 Parse a Reduct string.
 
REDUCT_API reduct_handle_t reduct_parse_file (reduct_t *reduct, const char *path)
 Parse a Reduct file.
 

Function Documentation

◆ reduct_parse()

REDUCT_API reduct_handle_t reduct_parse ( reduct_t reduct,
const char *  str,
size_t  len,
const char *  path 
)

Parse a Reduct string.

Warning
The jump buffer must have been set using REDUCT_ERROR_CATCH before calling this function.
Parameters
reductPointer to the Reduct structure.
strThe Reduct string to parse. The caller is responsible for the memory of this string, it must not be freed for the lifetime of the parsed items.
lenThe length of the input string.
pathThe path to the file being parsed (for error reporting).
Returns
The root item of the parsed expression, will be retained by the GC.

◆ reduct_parse_file()

REDUCT_API reduct_handle_t reduct_parse_file ( reduct_t reduct,
const char *  path 
)

Parse a Reduct file.

Warning
The jump buffer must have been set using REDUCT_ERROR_CATCH before calling this function.
Parameters
reductPointer to the Reduct structure.
pathThe path to the file to parse.
Returns
The root item of the parsed expression, will be retained by the GC.