decode

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidIndent

func InvalidIndent(want, got token.Pos) invalidIndent

Types

type Decoder

type Decoder struct {

	// configure the tokenizer for the next decode
	UseFloats bool
	// contains filtered or unexported fields
}

the decoder is *not* ready to use by default the mapper, sequencer, and notes need to be set.

func (*Decoder) Decode

func (d *Decoder) Decode(src io.RuneReader) (ret any, err error)

read a tell document from the passed stream

func (*Decoder) Position

func (d *Decoder) Position() (x int, y int)

func (*Decoder) SetMapper

func (d *Decoder) SetMapper(maps collect.MapFactory)

configure the production of mappings

func (*Decoder) SetSequencer

func (d *Decoder) SetSequencer(seq collect.SequenceFactory)

configure the production of sequences

func (*Decoder) UseNotes

func (d *Decoder) UseNotes(b *note.Book)

pass a valid target for document level comments a nil disables comment collection ( comments are disabled by default )

type ErrorPos

type ErrorPos struct {
	// contains filtered or unexported fields
}

func ErrorAt

func ErrorAt(y, x int, err error) ErrorPos

func (ErrorPos) Error

func (e ErrorPos) Error() string

func (ErrorPos) Pos

func (e ErrorPos) Pos() (y int, x int)

func (ErrorPos) Unwrap

func (e ErrorPos) Unwrap() error

Jump to

Keyboard shortcuts

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