luerl_io (luerl v1.5.1)

View Source

This module provides a standard of set io functions for Luerl. In the following description, many functions have an optional parameter IoDevice. If included, it must be the pid of a process which handles the IO protocols such as the IoDevice returned by file:open/2. Also in the functions handling files it can also be the name of the file which will then be opened.

Note that Luerl, following Lua, does do any implicit UTF-8 encoding of input strings.

Summary

Functions

Read a line of text from IoDevice withe the prompt Prompt. We make sure that anu UTF-8 encoding is done before we return the data.

Parse the file FileName and return the chunk in it. FileName can also be an IoDevice of an already opened file.

Scan the file FileName and return the tokens in it. FileName can also be an IoDevice of an already opened file.

Functions

collect_line(Stack, Data)

get_line()

Equivalent to get_line(standard_io, '').

get_line(Prompt)

Equivalent to get_line(standard_io, Prompt).

get_line(IoDevice, Prompt)

Read a line of text from IoDevice withe the prompt Prompt. We make sure that anu UTF-8 encoding is done before we return the data.

parse_file(FileName)

Equivalent to parse_file(FileName, 1).

parse_file(FileName, Line)

Parse the file FileName and return the chunk in it. FileName can also be an IoDevice of an already opened file.

scan_file(FileName)

Equivalent to scan_file(FileName, 1).

scan_file(FileName, Line)

Scan the file FileName and return the tokens in it. FileName can also be an IoDevice of an already opened file.