analysis

package
v0.0.0-...-3cc2fd5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

utilities used by mutation operators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTypeMap

func BuildTypeMap(fn *ast.FuncDecl) map[string]string

func CloneBlockStmt

func CloneBlockStmt(stmt *ast.BlockStmt) *ast.BlockStmt

func CloneStmt

func CloneStmt(stmt ast.Stmt) ast.Stmt

func FindNode

func FindNode(node, target ast.Node) bool

func FindParentNode

func FindParentNode(target ast.Node, file *ast.File, predicates ...func(ast.Node) bool) ast.Node

func HasCompatibleVar

func HasCompatibleVar(vars []VarInfo, exclude, targetType string) bool

func IsBoolLiteral

func IsBoolLiteral(expr ast.Expr) bool

func IsErrorCall

func IsErrorCall(expr ast.Expr) bool

func IsErrorExpr

func IsErrorExpr(expr ast.Expr) bool

func IsErrorNil

func IsErrorNil(expr ast.Expr) bool

func IsInsideCaseClause

func IsInsideCaseClause(ret *ast.ReturnStmt, file *ast.File) bool

func IsInsideIfStmt

func IsInsideIfStmt(n ast.Node, parent ast.Node) bool

func IsInsideLoop

func IsInsideLoop(n ast.Node, file *ast.File) bool

func IsNumericIdent

func IsNumericIdent(name string) bool

func IsNumericLiteral

func IsNumericLiteral(expr ast.Expr) bool

func IsReturnStmtWithResults

func IsReturnStmtWithResults(n ast.Node, min int) (*ast.ReturnStmt, bool)

func IsStringLiteral

func IsStringLiteral(expr ast.Expr) bool

func ResolveType

func ResolveType(expr ast.Expr, typeMap map[string]string) string

func TypeExprToString

func TypeExprToString(expr ast.Expr) string

func TypesCompatible

func TypesCompatible(a, b string) bool

Types

type VarInfo

type VarInfo struct {
	Name string
	Type string
}

func CollectVars

func CollectVars(fn *ast.FuncDecl) []VarInfo

func FindCompatibleVar

func FindCompatibleVar(vars []VarInfo, exclude, targetType string) VarInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL