gem

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: MIT Imports: 2 Imported by: 3

Documentation

Overview

Package gem provides a GEneric Model for XSX data

Example
scn := xsx.NewDefaultScanner(strings.NewReader(
	`(foo \[bar] \baz)`,
))
gem, err := Parse(scn)
if err != nil {
	fmt.Println(err)
} else {
	wr := xsx.NewDefaultWriter(os.Stdout)
	gem.Write(wr)
	wr.Flush()
}
Output:

(foo \[bar] \baz)

Index

Examples

Constants

This section is empty.

Variables

View Source
var Void void

Functions

This section is empty.

Types

type Atom

type Atom struct {
	Text string
	// contains filtered or unexported fields
}

func (Atom) Meta

func (b Atom) Meta() bool

func (*Atom) SetMeta

func (b *Atom) SetMeta(meta bool)

func (*Atom) Write added in v0.8.0

func (a *Atom) Write(w *xsx.Writer) (n int, err error)

type Sequence

type Sequence struct {
	Bracket int
	Elem    []XSX
	// contains filtered or unexported fields
}

func (Sequence) Meta

func (b Sequence) Meta() bool

func (*Sequence) SetMeta

func (b *Sequence) SetMeta(meta bool)

func (*Sequence) Write added in v0.8.0

func (s *Sequence) Write(w *xsx.Writer) (n int, err error)

type XSX added in v0.8.0

type XSX interface {
	Meta() bool
	SetMeta(bool)
	Write(*xsx.Writer) (int, error)
}

func Parse

func Parse(s *xsx.Scanner) (res XSX, err error)

Jump to

Keyboard shortcuts

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