Documentation
¶
Index ¶
- Constants
- func ParseAccount(b *Scanner) (*accounts.Account, error)
- func ParseAccountType(b *Scanner) (accounts.AccountType, error)
- func ParseCommodity(p *Scanner) (*commodities.Commodity, error)
- func ParseDate(p *Scanner) (time.Time, error)
- func ParseDecimal(p *Scanner) (decimal.Decimal, error)
- func ParseFloat(p *Scanner) (float64, error)
- func ParseIdentifier(b *Scanner) (string, error)
- func ReadQuotedString(b *Scanner) (string, error)
- func ReadString(p *Scanner, n int) (string, error)
- type Scanner
- func (s *Scanner) Advance() error
- func (s *Scanner) ConsumeRune(r rune) error
- func (s *Scanner) ConsumeUntil(pred func(r rune) bool) error
- func (s *Scanner) ConsumeWhile(pred func(r rune) bool) error
- func (s *Scanner) Current() rune
- func (s *Scanner) ParseError(err error) error
- func (s *Scanner) ParseString(str string) error
- func (s *Scanner) Position() model.FilePosition
- func (s *Scanner) ReadRune() (r rune, size int, err error)
- func (s *Scanner) ReadWhile(pred func(r rune) bool) (string, error)
Constants ¶
View Source
const EOF = rune(0)
EOF is a rune representing the end of a file
Variables ¶
This section is empty.
Functions ¶
func ParseAccount ¶
ParseAccount parses an account
func ParseAccountType ¶
func ParseAccountType(b *Scanner) (accounts.AccountType, error)
ParseAccountType parses an account type
func ParseCommodity ¶
func ParseCommodity(p *Scanner) (*commodities.Commodity, error)
ParseCommodity parses a commodity
func ParseDecimal ¶
ParseDecimal parses a decimal number
func ParseFloat ¶
ParseFloat parses a floating point number
func ParseIdentifier ¶
ParseIdentifier parses an identifier
func ReadQuotedString ¶
ReadQuotedString parses a quoted string
Types ¶
type Scanner ¶
type Scanner struct { // Path is the file path. Path string // contains filtered or unexported fields }
Scanner is a backtracking reader.
func (*Scanner) ConsumeRune ¶
ConsumeRune consumes the given rune
func (*Scanner) ConsumeUntil ¶
ConsumeUntil advances the parser until the predicate holds
func (*Scanner) ConsumeWhile ¶
ConsumeWhile advances the parser while the predicate holds
func (*Scanner) ParseError ¶ added in v0.0.6
ParseError creates a new parser error with the current position.
func (*Scanner) ParseString ¶
ParseString parses the given string
func (*Scanner) Position ¶
func (s *Scanner) Position() model.FilePosition
Position returns the current position.
Click to show internal directories.
Click to hide internal directories.