API

group yao

Public function definitions and types for Yao.

Typedefs

typedef y_Status (*yao_ParseAddImportsFunc)(struct yao_Parse *p)

A function type for a function to add more data into an import map when a new import map is pushed onto the stack.

This is for Rig and Ur, especially, for them to add their keywords and such to the new import map so that no import declarations are required.

Param p:

The parser.

Return:

An error code, if any.

Pre:

p must not be NULL.

Functions

y_Status yao_read(yvm_Yvm y, size_t errlim, y_Path path, yao_ParseAddImportsFunc add)

Reads a Yao file and parses it into executable Yao code.

Parameters:
  • y – The Yvm code container to fill with the parsed code.

  • errlim – The error limit. Zero means no limit.

  • path – The path to the file to parse.

  • add – A function to add extra imports, if needed. Can be NULL.

Returns:

An error code, if any.

Pre:

y must not be NULL.

Pre:

path must be valid.