code: func SetNodeGlobals(node ast.Node, globals data.Map) error {
  	switch node := node.(type) {
  	case *ast.GlobalNode:
  		if val, ok := globals[node.Name]; ok {
  			node.Value = val
  		} else {
  			return fmt.Errorf("global %q is undefined", node.Name)
  		}
  	default:
  		if parent, ok := node.(ast.ParentNode); ok {
  			for _, child := range parent.Children() {
  				if err := SetNodeGlobals(child, globals); err != nil {
  					return err
  				}
  			}
  		}
  	}
  	return nil
  }
docs: // SetNodeGlobals sets global values on the given node and all children nodes,
  // using the given data map.  An error is returned if any global nodes were left
  // undefined.