ast

package
v0.0.0-...-09be31c Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	Elements []Value
	Pos_     Position
	End_     Position
}

Array represents a HOCON array

func (*Array) End

func (a *Array) End() Position

func (*Array) Pos

func (a *Array) Pos() Position

func (*Array) String

func (a *Array) String() string

type Boolean

type Boolean struct {
	Value bool
	Pos_  Position
	End_  Position
}

Boolean represents true/false

func (*Boolean) End

func (b *Boolean) End() Position

func (*Boolean) Pos

func (b *Boolean) Pos() Position

func (*Boolean) String

func (b *Boolean) String() string

type Concatenation

type Concatenation struct {
	Values []Value
	Pos_   Position
	End_   Position
}

Concatenation represents value concatenation

func (*Concatenation) End

func (c *Concatenation) End() Position

func (*Concatenation) Pos

func (c *Concatenation) Pos() Position

func (*Concatenation) String

func (c *Concatenation) String() string

type Duration

type Duration struct {
	Value       float64      // Numeric value
	Unit        DurationUnit // Unit of duration
	Raw         string       // Original text
	Nanoseconds int64        // Normalized to nanoseconds
	Pos_        Position
	End_        Position
}

Duration represents a duration literal (e.g., 10s, 500ms)

func (*Duration) End

func (d *Duration) End() Position

func (*Duration) Pos

func (d *Duration) Pos() Position

func (*Duration) String

func (d *Duration) String() string

type DurationUnit

type DurationUnit int

DurationUnit represents a time duration unit

const (
	Nanoseconds DurationUnit = iota
	Microseconds
	Milliseconds
	Seconds
	Minutes
	Hours
	Days
)

func (DurationUnit) String

func (u DurationUnit) String() string

type Field

type Field struct {
	Path  *Path
	Sep   Separator
	Value Value
	Pos_  Position
	End_  Position
}

Field represents a key-value pair in an object

func (*Field) End

func (f *Field) End() Position

func (*Field) Pos

func (f *Field) Pos() Position

func (*Field) String

func (f *Field) String() string

type Include

type Include struct {
	Type     IncludeType
	Path     string
	Required bool
	Pos_     Position
	End_     Position
}

Include represents include directives

func (*Include) End

func (i *Include) End() Position

func (*Include) Pos

func (i *Include) Pos() Position

func (*Include) String

func (i *Include) String() string

type IncludeType

type IncludeType int

IncludeType represents the type of include directive

const (
	IncludeFile IncludeType = iota
	IncludeURL
	IncludeClasspath
)

func (IncludeType) String

func (it IncludeType) String() string

type Node

type Node interface {
	Pos() Position  // Starting position
	End() Position  // Ending position
	String() string // Human-readable representation
}

Node is the base interface for all AST nodes

type Null

type Null struct {
	Pos_ Position
	End_ Position
}

Null represents null value

func (*Null) End

func (n *Null) End() Position

func (*Null) Pos

func (n *Null) Pos() Position

func (*Null) String

func (n *Null) String() string

type Number

type Number struct {
	Value float64
	Raw   string
	Pos_  Position
	End_  Position
}

Number represents a numeric value

func (*Number) End

func (n *Number) End() Position

func (*Number) Pos

func (n *Number) Pos() Position

func (*Number) String

func (n *Number) String() string

type Object

type Object struct {
	Fields []*Field
	Pos_   Position
	End_   Position
}

Object represents a HOCON object

func (*Object) End

func (o *Object) End() Position

func (*Object) Pos

func (o *Object) Pos() Position

func (*Object) String

func (o *Object) String() string

type Path

type Path struct {
	Elements []*PathElement
	Pos_     Position
	End_     Position
}

Path represents a dot-separated path

func (*Path) End

func (p *Path) End() Position

func (*Path) Pos

func (p *Path) Pos() Position

func (*Path) String

func (p *Path) String() string

type PathElement

type PathElement struct {
	Value  string
	Quoted bool
	Pos_   Position
	End_   Position
}

PathElement is a single component of a path

func (*PathElement) End

func (pe *PathElement) End() Position

func (*PathElement) Pos

func (pe *PathElement) Pos() Position

func (*PathElement) String

func (pe *PathElement) String() string

type Position

type Position struct {
	Filename string
	Line     int
	Column   int
	Offset   int
}

Position tracks a location in the source file

func (Position) String

func (p Position) String() string

String returns a human-readable representation of the position

type Root

type Root struct {
	Value Value
	Pos_  Position
	End_  Position
}

Root represents the top-level document

func (*Root) End

func (r *Root) End() Position

func (*Root) Pos

func (r *Root) Pos() Position

func (*Root) String

func (r *Root) String() string

type Separator

type Separator int

Separator represents the separator between key and value

const (
	SeparatorColon Separator = iota
	SeparatorEquals
	SeparatorNone
)

func (Separator) String

func (s Separator) String() string

type Size

type Size struct {
	Value float64  // Numeric value
	Unit  SizeUnit // Unit of size
	Raw   string   // Original text
	Bytes int64    // Normalized to bytes
	Pos_  Position
	End_  Position
}

Size represents a size literal (e.g., 512M, 1GB)

func (*Size) End

func (s *Size) End() Position

func (*Size) Pos

func (s *Size) Pos() Position

func (*Size) String

func (s *Size) String() string

type SizeUnit

type SizeUnit int

SizeUnit represents a size unit

const (
	Bytes SizeUnit = iota
	Kilobytes
	Megabytes
	Gigabytes
	Terabytes
	Petabytes
	Exabytes
	Zettabytes
)

func (SizeUnit) String

func (u SizeUnit) String() string

type String

type String struct {
	Value     string
	Quoted    bool
	MultiLine bool
	Pos_      Position
	End_      Position
}

String represents a string value (quoted or unquoted)

func (*String) End

func (s *String) End() Position

func (*String) Pos

func (s *String) Pos() Position

func (*String) String

func (s *String) String() string

type Substitution

type Substitution struct {
	Path     *Path
	Optional bool
	Default  Value // default value for :- syntax, nil if not present
	Pos_     Position
	End_     Position
}

Substitution represents ${path} or ${?path} or ${path :- default}

func (*Substitution) End

func (s *Substitution) End() Position

func (*Substitution) Pos

func (s *Substitution) Pos() Position

func (*Substitution) String

func (s *Substitution) String() string

type Value

type Value interface {
	Node
	// contains filtered or unexported methods
}

Value represents any HOCON value

Source Files

  • ast.go
  • nodes.go

Jump to

Keyboard shortcuts

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