run

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2022 License: BSD-3-Clause Imports: 10 Imported by: 6

Documentation

Overview

Package run provides the execution control for ivy. It is factored out of main so it can be used for tests. This layout also helps out ivy/mobile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ivy added in v0.1.4

func Ivy(context value.Context, expr string, stdout, stderr *bytes.Buffer)

Ivy evaluates the input string, appending standard output and error output to the provided buffers, which it does by calling context.Config.SetOutput and SetError. If execution caused errors, they will be returned concatenated together in the error value returned.

func IvyEval

func IvyEval(context value.Context, str string) value.Value

IvyEval is the function called by value/unaryIvy to implement the ivy (eval) operation. It is exported but is not intended to be used outside of ivy.

func Run

func Run(p *parse.Parser, context value.Context, interactive bool) (success bool)

Run runs the parser/evaluator until EOF or error. The return value says whether we completed without error. If the return value is true, it means we ran out of data (EOF) and the run was successful. Typical execution is therefore to loop calling Run until it succeeds. Error details are reported to the configured error output stream.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL