scalarappendix

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(rows []plantree.RowWithPredicates, opts Options) (string, error)

Render renders the configured scalar appendices without a leading separator.

func ValidateSections

func ValidateSections(sections Sections) error

ValidateSections validates an ordered print-section list.

Types

type Options

type Options struct {
	// Sections selects appendix sections.
	// A nil value uses the default SectionPredicates section.
	// An explicitly empty value renders no appendix sections.
	Sections *Sections

	// ShowScalarVars prints scalar assignment variable names in semantic appendix sections.
	ShowScalarVars bool

	// ResolveScalarVars replaces direct scalar variable aliases in semantic appendix sections.
	ResolveScalarVars bool

	// ResolveScalarVarsRecursive recursively resolves scalar variable aliases in semantic appendix sections.
	ResolveScalarVarsRecursive bool
}

Options configures appendix rendering.

type Preset added in v0.1.11

type Preset string

Preset selects an intent-based appendix section set.

const (
	// PresetBasic prints predicate-like scalar links.
	PresetBasic Preset = "basic"
	// PresetEnhanced prints predicate, ordering, and aggregate sections.
	PresetEnhanced Preset = "enhanced"
	// PresetFull prints all scalar links, including unnamed links.
	PresetFull Preset = "full"
	// PresetNone suppresses appendix sections.
	PresetNone Preset = "none"
)

func ParsePreset added in v0.1.11

func ParsePreset(s string) (Preset, error)

ParsePreset parses one print preset name. Valid values are "basic", "enhanced", "full", and "none" (case-insensitive). Empty input is not a preset; use ParseSections for explicit-empty appendix semantics.

func (Preset) Sections added in v0.1.11

func (p Preset) Sections() (Sections, error)

Sections returns the appendix sections for p.

type Section

type Section string

Section selects one appendix section printed after a rendered tree table.

const (
	// SectionPredicates prints predicate-like scalar links.
	SectionPredicates Section = "predicates"
	// SectionOrdering prints ordering scalar links for sort operators.
	SectionOrdering Section = "ordering"
	// SectionAggregate prints grouping and aggregate scalar links for aggregate operators.
	SectionAggregate Section = "aggregate"
	// SectionTyped prints all typed scalar links as a raw debug dump.
	SectionTyped Section = "typed"
	// SectionFull prints all scalar links, including unnamed links, as a raw debug dump.
	SectionFull Section = "full"
)

func ParseSection

func ParseSection(s string) (Section, error)

ParseSection parses one print-section name. Valid values are "predicates", "ordering", "aggregate", "typed", and "full" (case-insensitive).

type Sections

type Sections []Section

Sections is an ordered list of appendix sections.

func ParseSections

func ParseSections(s string) (Sections, error)

ParseSections parses a named preset or a comma-separated print-section list. Empty or blank input returns a non-nil empty list, which renders no appendix sections.

Jump to

Keyboard shortcuts

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