Documentation ¶
Index ¶
- func NewParser() (*participle.Parser[REPLDirective], error)
- type ExecDirective
- type LetDirective
- type LoadDirective
- type Output
- type PrinterOutput
- func (po *PrinterOutput) Print(format string, args ...any)
- func (po *PrinterOutput) PrintErr(msg string, err error)
- func (po *PrinterOutput) PrintJSON(obj any)
- func (po *PrinterOutput) PrintResult(name string, value ref.Val)
- func (po *PrinterOutput) PrintRule(id int, rule proto.Message) error
- func (po *PrinterOutput) PrintYAML(obj proto.Message, indent int)
- type REPL
- type REPLDirective
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewParser ¶
func NewParser() (*participle.Parser[REPLDirective], error)
Types ¶
type ExecDirective ¶ added in v0.16.0
type ExecDirective struct {
RuleID int `parser:"'exec' '#'@Int"`
}
type LetDirective ¶
type LoadDirective ¶ added in v0.16.0
type LoadDirective struct {
Path string `parser:"'load' @Path"`
}
type PrinterOutput ¶
func NewPrinterOutput ¶
func NewPrinterOutput(stdout, stderr io.Writer) *PrinterOutput
func (*PrinterOutput) Print ¶
func (po *PrinterOutput) Print(format string, args ...any)
func (*PrinterOutput) PrintErr ¶
func (po *PrinterOutput) PrintErr(msg string, err error)
func (*PrinterOutput) PrintJSON ¶
func (po *PrinterOutput) PrintJSON(obj any)
func (*PrinterOutput) PrintResult ¶
func (po *PrinterOutput) PrintResult(name string, value ref.Val)
type REPLDirective ¶
type REPLDirective struct { Exit bool `parser:"@('q'|'quit'|'exit')"` Reset bool `parser:"| @'reset'"` Vars bool `parser:"| @'vars'"` Help bool `parser:"| @('h' | 'help')"` Rules bool `parser:"| @'rules'"` Load *LoadDirective `parser:"| @@"` Exec *ExecDirective `parser:"| @@"` Let *LetDirective `parser:"| @@"` }
Click to show internal directories.
Click to hide internal directories.