Documentation ¶
Overview ¶
Package eval handles evaluation of nodes and consists the runtime of the shell.
Index ¶
Constants ¶
const ( Ok exitusSort = iota Failure Traceback // Control flow sorts Return Break Continue FlowSortLower = Return )
Variables ¶
var BuiltinFnNames []string
var BuiltinSpecialNames []string
Functions ¶
func HasFailure ¶
func PrintExituses ¶
func PrintExituses(vs []Value)
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler compiles an Elvish AST into an Op.
func NewCompiler ¶
NewCompiler returns a new compiler.
type Evaler ¶
type Evaler struct { Compiler *Compiler // contains filtered or unexported fields }
Evaler is used to evaluate elvish sources. It maintains runtime context shared among all evalCtx instances.
func (*Evaler) Eval ¶
Eval evaluates a chunk node n. The supplied name and text are used in diagnostic messages.
Notes ¶
Bugs ¶
Possible error of os.Getwd after cd-ing is ignored.
mayAssign uses a wrong way to check the equality of two interfaces, which happens to work when all the Type instances are empty structs.
We rely on the fact that os.Unsetenv always returns nil.
When evaluating closures, async access to global variables and ports can be problematic.
valueEq uses reflect.DeepEqual to check the equality of two values, may can become wrong when values get more complex.