ccl

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(n CCLNode, ctx Context) (any, error)

Evaluate evaluates a CCL node with the given context.

func GetAssignmentTarget

func GetAssignmentTarget(n CCLNode) (string, bool)

GetAssignmentTarget returns the assignment target column name/index.

func IsAssignmentNode

func IsAssignmentNode(n CCLNode) bool

IsAssignmentNode reports whether the node is an assignment.

func IsNewColNode

func IsNewColNode(n CCLNode) bool

IsNewColNode reports whether the node creates a new column.

func IsRowDependent

func IsRowDependent(n CCLNode) bool

IsRowDependent reports whether the node depends on row context.

func RegisterAggregateFunction

func RegisterAggregateFunction(name string, fn AggFunc)

RegisterAggregateFunction registers a custom aggregate function.

func RegisterFunction

func RegisterFunction(name string, fn Func)

RegisterFunction registers a custom scalar function.

func RegisterStandardFunctions

func RegisterStandardFunctions()

RegisterStandardFunctions registers the built-in CCL functions.

func ResetEvalDepth

func ResetEvalDepth()

ResetEvalDepth resets the evaluator recursion depth.

func ResetFuncCallDepth

func ResetFuncCallDepth()

ResetFuncCallDepth resets the function call depth counter.

Types

type AggFunc

type AggFunc = internalccl.AggFunc

type CCLNode

type CCLNode = internalccl.CCLNode

func Bind

func Bind(n CCLNode, colNameMap map[string]int) (CCLNode, error)

Bind resolves column references to indices.

func CompileExpression

func CompileExpression(expression string) (CCLNode, error)

CompileExpression compiles a CCL expression into an AST.

func CompileMultiline

func CompileMultiline(script string) ([]CCLNode, error)

CompileMultiline compiles a multi-line CCL script into AST nodes.

func GetExpressionNode

func GetExpressionNode(n CCLNode) CCLNode

GetExpressionNode returns the expression node for a statement.

func GetNewColInfo

func GetNewColInfo(n CCLNode) (string, CCLNode, bool)

GetNewColInfo returns the new column info if the node creates one.

type Context

type Context = internalccl.Context

CCL types

type EvaluationResult

type EvaluationResult = internalccl.EvaluationResult

func EvaluateStatement

func EvaluateStatement(n CCLNode, ctx Context) (*EvaluationResult, error)

EvaluateStatement evaluates a CCL statement and returns detailed result.

type Func

type Func = internalccl.Func

type MapContext

type MapContext = internalccl.MapContext

func NewMapContext

func NewMapContext(data map[string][]any) (*MapContext, error)

NewMapContext creates a map-based CCL context.

Jump to

Keyboard shortcuts

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