Documentation ¶
Index ¶
- Constants
- func ExtractComment(markup map[string]any) (ret []string, err error)
- func IsMarkup(s string) (okay bool)
- func IsUnhandled(e error) bool
- func JoinComment(markup map[string]any) (ret string)
- func JoinLines(slice []any) (ret string, okay bool)
- func MakeSourceError(src Source, e error) (err error)
- func MessageError(msg Message, e error) error
- func SliceBools(slice []any) ([]bool, bool)
- func SliceFloats(slice []any) ([]float64, bool)
- func SliceStrings(slice []any) ([]string, bool)
- func UserComment(markup map[string]any) (ret []string)
- type Message
- type Source
- type SourceError
- type Unhandled
Constants ¶
const ( Comment = "--" File = "src" Position = "pos" )
Common markup keys in tapestry compact (if) files. the comment marker was chosen to be distinctive and to sort in front of all other keys (ie. when using go's json encoder. )
Variables ¶
This section is empty.
Functions ¶
func ExtractComment ¶ added in v0.24.6
extract a comment string or strings from the passed msg markup. returns nil if no comment existed. errors if some data existed that couldn't be interpreted.
func IsUnhandled ¶
func JoinComment ¶ added in v0.24.8
ignores errors and returns a blank string
func JoinLines ¶
type conversion: convert a slice of interfaces to a slice of strings joined with newlines.
func MakeSourceError ¶ added in v0.24.8
func MessageError ¶ added in v0.24.8
func SliceBools ¶
type conversion: convert a slice containing bool values into a bool slice. returns false if any member of the slice isnt a bool
func SliceFloats ¶
type conversion: convert a slice containing float values into a float slice. returns false if any member of the slice isnt a float64
func SliceStrings ¶
type conversion: convert a slice containing string values into a string slice. returns false if any member of the slice isnt a string
func UserComment ¶
read a user comment from markup, normalizing it as an array of strings
Types ¶
type Message ¶
type Message struct { Key string // original specified text: "Sig:label:" Lede string // the leading part of the signature in lowercase Labels []string // parameter names sans colons; the first can be blank ( anonymous ) Args []any // the same length as labels Markup map[string]any // from lowercase keys and comments }
A decoding of a tapestry command. Commands on disk are stored as plain value maps containing a command signature and command data pair; and any number of markup key-value pairs. Signatures start with a capital letter, and contain parameter names separated by colons. Markup keys start with a double dash.
type Source ¶ added in v0.24.8
type Source struct { File string // enough to locate the data Line int // a zero-offset printed as one-offset. Comment string }
the compact format stores source file info inside the metadata.
func MakeSource ¶ added in v0.24.8
func (Source) CompactPos ¶ added in v0.24.8
return the source position as line:base(path)
func (Source) ErrorString ¶ added in v0.24.8
type SourceError ¶ added in v0.24.8
type SourceError struct {
// contains filtered or unexported fields
}
func (SourceError) Error ¶ added in v0.24.8
func (e SourceError) Error() (ret string)
func (SourceError) Source ¶ added in v0.24.8
func (e SourceError) Source() Source
func (SourceError) Unwrap ¶ added in v0.24.8
func (e SourceError) Unwrap() error