parser

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(filename string, src []byte, format Format) (*model.Diagram, error)

Parse parses src in the given format and returns a Diagram. If format is FormatAuto, the format is detected from the filename extension.

func ParseOld added in v0.1.4

func ParseOld(r io.Reader) (*model.Diagram, error)

ParseOld reads a .pta file using the hand-written FSM parser.

Types

type Format added in v0.1.4

type Format int

Format identifies a plain-text accounting file format.

const (
	FormatAuto      Format = iota // detect from filename extension
	FormatPTA                     // .pta (directional movements)
	FormatGoluca                  // .goluca (like PTA with quoted descriptions)
	FormatBeancount               // .beancount (postings with signed amounts)
)

func DetectFormat added in v0.1.4

func DetectFormat(filename string) Format

DetectFormat returns the Format for a filename based on extension.

func FormatFromString added in v0.1.4

func FormatFromString(s string) (Format, error)

FormatFromString converts a CLI flag value to a Format.

Jump to

Keyboard shortcuts

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