Exemple #1
0
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
}
Exemple #2
0
func evalRift(rift *lang.Rift, env collections.PersistentMap) {
	logging.Debug("Evaluating rift [%s]", rift.Name())
	for _, line := range rift.Lines() {
		evaluate(rift, env, line)
	}
}