Example #1
0
File: vm.go Project: 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
}
Example #2
0
File: vm.go Project: 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)
	}
}