Documentation ¶
Overview ¶
Package charmed provides common useful states for document parsing
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterInvalidRunes ¶
returns an state which errors on all control codes other than newlines
func StringMatch ¶
returns error if failed to match, or unhandled on the rune after the matched string. the empty string will return unmatched immediately.
Types ¶
type NumParser ¶
type NumParser struct {
// contains filtered or unexported fields
}
return a state which reads until the end of string, returns error if finished incorrectly
func (*NumParser) Decode ¶
return a state capable of digit parsing. note: this doesn't support leading with just a "."
type QuoteDecoder ¶
wraps a string builder to read a quoted string or heredoc.
func (*QuoteDecoder) Interpret ¶
func (d *QuoteDecoder) Interpret() charm.State
read until an InterpretedString (") end marker is found for heredocs: pass the indentation of the starting quote
func (*QuoteDecoder) Record ¶
func (d *QuoteDecoder) Record() charm.State
read until an RawString (`) end marker is found for heredocs: pass the indentation of the starting quote