Exemplo n.º 1
0
Arquivo: vm.go Projeto: jerluc/rift
func doAssignment(rift *lang.Rift, env collections.PersistentMap, assignment *lang.Assignment) interface{} {
	// TODO: Should I use lazy assignment here?
	var name string
	if rift.Name() == "main" {
		name = assignment.Ref().String()
	} else {
		name = rift.Name() + ":" + assignment.Ref().String()
	}
	env.Set(name, evaluate(rift, env, assignment.Value()))
	return nil
}
Exemplo n.º 2
0
Arquivo: vm.go Projeto: jerluc/rift
func evalRift(rift *lang.Rift, env collections.PersistentMap) {
	logging.Debug("Evaluating rift [%s]", rift.Name())
	for _, line := range rift.Lines() {
		evaluate(rift, env, line)
	}
}