// WalkAlter walks the Alter plan.
547427
func (m *JobExecutor) WalkAlter(p *plan.Alter) (Task, error) {
	root := m.NewTask(p)
	return root, root.Add(NewAlter(m.Ctx, p))
}
310282
func (m *rewrite) walkArrayNode(node *expr.ArrayNode) (expr.Node, error) {

	return node, nil
}
986423
func walkDir(dir string, outFileNamer func(string) (string, error), excludeGlob []string, mode os.FileMode, modeOverride bool) ([]*tplate, error) {
	dir = filepath.Clean(dir)

	dirStat, err := fs.Stat(dir)
	if err != nil {
		return nil, err
	}
	dirMode := dirStat.Mode()

	templates := make([]*tplate, 0)
	matcher := xignore.NewMatcher(fs)
	matches, err := matcher.Matches(dir, &xignore.MatchesOptions{
		Ignorefile:    gomplateignore,
		Nested:        true, // allow nested ignorefile
		AfterPatterns: excludeGlob,
	})
	if err != nil {
		return nil, err
	}

	// Unmatched ignorefile rules's files
	files := matches.UnmatchedFiles
	for _, file := range files {
		nextInPath := filepath.Join(dir, file)
		nextOutPath, err := outFileNamer(file)
		if err != nil {
			return nil, err
		}

		fMode := mode
		if mode == 0 {
			stat, perr := fs.Stat(nextInPath)
			if perr == nil {
				fMode = stat.Mode()
			} else {
				fMode = dirMode
			}
		}

		// Ensure file parent dirs
		if err = fs.MkdirAll(filepath.Dir(nextOutPath), dirMode); err != nil {
			return nil, err
		}

		templates = append(templates, &tplate{
			name:         nextInPath,
			targetPath:   nextOutPath,
			mode:         fMode,
			modeOverride: modeOverride,
		})
	}

	return templates, nil
}
342666
func WalkTerms(x interface{}, f func(*Term) bool) {
	vis := &GenericVisitor{func(x interface{}) bool {
		if term, ok := x.(*Term); ok {
			return f(term)
		}
		return false
	}}
	Walk(vis, x)
}
74287
func (m *JobExecutor) WalkCommand(p *plan.Command) (Task, error) {
	root := m.NewTask(p)
	return root, root.Add(NewCommand(m.Ctx, p))
}
718970
func WalkClosures(x interface{}, f func(interface{}) bool) {
	vis := &GenericVisitor{func(x interface{}) bool {
		switch x.(type) {
		case *ArrayComprehension, *ObjectComprehension, *SetComprehension:
			return f(x)
		}
		return false
	}}
	Walk(vis, x)
}
503831
func walkIdentList(v Visitor, list []*Ident) {
	for _, x := range list {
		Walk(v, x)
	}
}
262185
func WalkDir(basePathIn string, opts *WalkOpts) (*Container, error) {
	filter := opts.Filter

	if filter == nil {
		filter = DefaultFilter
	}

	var Dirs []*Dir
	var Symlinks []*Symlink
	var Files []*File

	currentlyWalking := make(map[string]bool)

	TotalOffset := int64(0)

	var makeEntryCallback func(BasePath string, LocationPath string) filepath.WalkFunc

	makeEntryCallback = func(BasePath string, LocationPath string) filepath.WalkFunc {
		return func(FullPath string, fileInfo os.FileInfo, err error) error {
			// we shouldn't encounter any error crawling the repo
			if err != nil {
				if os.IsPermission(err) {
					// ...except permission errors, those are fine
					log.Printf("Permission error: %s\n", err.Error())
				} else {
					return errors.WithStack(err)
				}
			}

			Path, err := filepath.Rel(BasePath, FullPath)
			if err != nil {
				return errors.WithStack(err)
			}

			Path = filepath.Join(LocationPath, Path)

			Path = filepath.ToSlash(Path)
			if Path == "." {
				// Don't store a single folder named "."
				return nil
			}

			// os.Walk does not follow symlinks, so we must do it
			// manually if Dereference is set
			if opts.Dereference && fileInfo.Mode()&os.ModeSymlink > 0 {
				fileInfo, err = os.Stat(FullPath)
				if err != nil {
					return errors.WithStack(err)
				}

				if fileInfo.Mode().IsDir() {
					Dest, err := os.Readlink(FullPath)
					if err != nil {
						return errors.WithStack(err)
					}

					var JoinedDest string
					if filepath.IsAbs(Dest) {
						JoinedDest = Dest
					} else {
						JoinedDest = filepath.Join(filepath.Dir(FullPath), Dest)
					}

					CleanDest := filepath.Clean(JoinedDest)

					if currentlyWalking[CleanDest] {
						err := fmt.Errorf("symlinks recurse onto %s, cowardly refusing to walk infinite container", CleanDest)
						return errors.WithStack(err)
					}

					currentlyWalking[CleanDest] = true
					err = filepath.Walk(CleanDest, makeEntryCallback(CleanDest, Path))
					delete(currentlyWalking, CleanDest)
					if err != nil {
						return errors.WithStack(err)
					}
				}
			}

			// don't end up with files we (the patcher) can't modify
			Mode := fileInfo.Mode() | ModeMask

			if !filter(fileInfo) {
				if Mode.IsDir() {
					return filepath.SkipDir
				}
				return nil
			}

			if Mode.IsDir() {
				Dirs = append(Dirs, &Dir{Path: Path, Mode: uint32(Mode)})
			} else if Mode.IsRegular() {
				Size := fileInfo.Size()
				Offset := TotalOffset
				OffsetEnd := Offset + Size

				Files = append(Files, &File{Path: Path, Mode: uint32(Mode), Size: Size, Offset: Offset})
				TotalOffset = OffsetEnd
			} else if Mode&os.ModeSymlink > 0 {
				Dest, err := os.Readlink(FullPath)
				if err != nil {
					return errors.WithStack(err)
				}

				Dest = filepath.ToSlash(Dest)
				Symlinks = append(Symlinks, &Symlink{Path: Path, Mode: uint32(Mode), Dest: Dest})
			}

			return nil
		}
	}

	if basePathIn == NullPath {
		// empty container is fine - /dev/null is legal even on Win32 where it doesn't exist
	} else {
		basePathIn, err := filepath.Abs(basePathIn)
		if err != nil {
			return nil, errors.WithStack(err)
		}

		fi, err := os.Lstat(basePathIn)
		if err != nil {
			return nil, errors.WithStack(err)
		}

		if !fi.IsDir() {
			return nil, errors.Errorf("can't walk non-directory %s", basePathIn)
		}

		baseName := "."
		if opts.WrappedDir != "" {
			baseName = opts.WrappedDir
			basePathIn = filepath.Join(basePathIn, opts.WrappedDir)
		}

		currentlyWalking[basePathIn] = true
		err = filepath.Walk(basePathIn, makeEntryCallback(basePathIn, baseName))
		if err != nil {
			return nil, errors.WithStack(err)
		}
	}

	container := &Container{Size: TotalOffset, Dirs: Dirs, Symlinks: Symlinks, Files: Files}
	return container, nil
}
463676
func (nz *normalizer) WalkSelect(node SQLNode) (bool, error) {
	switch node := node.(type) {
	case *SQLVal:
		nz.convertSQLValDedup(node)
	case *ComparisonExpr:
		nz.convertComparison(node)
	case *ColName, TableName:
		// Common node types that never contain SQLVals or ListArgs but create a lot of object
		// allocations.
		return false, nil
	case OrderBy, GroupBy:
		// do not make a bind var for order by column_position
		return false, nil
	}
	return true, nil
}
921367
func (g *AcyclicGraph) Walk(cb WalkFunc) tfdiags.Diagnostics {
	defer g.debug.BeginOperation(typeWalk, "").End("")

	w := &Walker{Callback: cb, Reverse: true}
	w.Update(g)
	return w.Wait()
}
557033
func WalkExprs(x interface{}, f func(*Expr) bool) {
	vis := &GenericVisitor{func(x interface{}) bool {
		if r, ok := x.(*Expr); ok {
			return f(r)
		}
		return false
	}}
	Walk(vis, x)
}
363692
func (n *PropertyList) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Modifiers != nil {
		v.EnterChildList("Modifiers", n)
		for _, nn := range n.Modifiers {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("Modifiers", n)
	}

	if n.Properties != nil {
		v.EnterChildList("Properties", n)
		for _, nn := range n.Properties {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("Properties", n)
	}

	v.LeaveNode(n)
}
387977
func (n *CaseList) Walk(v walker.Visitor) {
	if v.EnterNode(n) == false {
		return
	}

	if n.Cases != nil {
		v.EnterChildList("Cases", n)
		for _, nn := range n.Cases {
			if nn != nil {
				nn.Walk(v)
			}
		}
		v.LeaveChildList("Cases", n)
	}

	v.LeaveNode(n)
}
505950
func (s *state) walkChild(node parse.Node) error {
	switch node := node.(type) {
	case *parse.BodyNode:
		for _, c := range node.All() {
			err := s.walkChild(c)
			if err != nil {
				return err
			}
		}
	case *parse.UseNode:
		return s.walkUseNode(node)
	}
	return nil
}
517541
func (b *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapshots.Info) error) error {
	ctx, t, err := b.ms.TransactionContext(ctx, false)
	if err != nil {
		return err
	}
	defer t.Rollback()
	return storage.WalkInfo(ctx, fn)
}
397501
func (l *Linter) walk(der []byte) {
	var err error
	var d asn1.RawValue

	for len(der) > 0 {
		der, err = asn1.Unmarshal(der, &d)
		if err != nil {
			// Errors should be included in the report, but allow format checking when
			// data has been decoded.
			l.e.Err(err.Error())
			if len(d.Bytes) == 0 {
				return
			}
		}

		// A compound is an ASN.1 container that contains other structs.
		if d.IsCompound {
			l.walk(d.Bytes)
		} else {
			l.CheckFormat(d)
		}
	}
}
300059
func (b *BinaryTree) WalkPostOrder() []Comparable {
	walked := make([]Comparable, 0, b.size)
	return walkPostOrder(b.root, walked)
}