reference

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT, MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reference is the reference evaluator of the query grammar: it walks the parse tree with the ANTLR visitor, the way the evaluator worked before rules were compiled. It exists to check the compiled evaluator of package parser against: the differential tests and fuzz targets compare the result, the error and the debug error of both. Production does not evaluate with it.

The package keeps its own copies of the small helpers it needs (the type assertions, the string literal reader, the keys of the debug error), so that the oracle does not share code with the evaluator it checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	// Err is the error of the rule.
	Err error
	// DebugErr is the error that the rule recorded for debugging, with the values that it was evaluated on.
	DebugErr error
	// Match is the result of the rule: false when Err is set.
	Match bool
}

Result is what Evaluate returns.

func Evaluate

func Evaluate(tree antlr.ParseTree, items map[string]any) Result

Evaluate evaluates a parse tree of the grammar against items by walking it with the visitor. It does not recover from the panics of the antlr runtime or of a failed type assertion: the caller does.

Jump to

Keyboard shortcuts

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