ident

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ident defines the node-pairing identity shared by parse, remediate, merge, and validate. Keyed nodes with a declared Kind pair by Kind and key across sibling templates. Key arguments join with a NUL separator. Block bodies are excluded so a body-only change becomes a Modify.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSection

func IsSection(n *tree.Node) bool

IsSection reports whether a node's schema definition declares children.

func KeyValue

func KeyValue(n *tree.Node) string

KeyValue joins a keyed node's key arguments for pairing and duplicate detection.

Types

type Category

type Category int

Category classifies a node for pairing purposes.

const (
	Unmatched        Category = iota // def == nil
	Keyed                            // len(KeyArgs()) > 0
	IdempotentSingle                 // idempotent && card in {ZeroToOne, One}
	FullLine                         // everything else
)

func CategoryOf

func CategoryOf(n *tree.Node) Category

CategoryOf classifies a tree node by its schema def.

type Ident

type Ident struct {
	Def  *schema.Node
	Kind string
	Key  string
}

Ident pairs keyed nodes by Kind and key across sibling templates, and other nodes by definition; block bodies are excluded.

func Of

func Of(n *tree.Node) Ident

Of computes a node's pairing identity.

Jump to

Keyboard shortcuts

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