Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unexpected ¶
Unexpected always fails with `message` as an unexpected error. Never consumes any input.
Example ¶
package main import ( "fmt" "github.com/flier/gocombine/pkg/parser/char" "github.com/flier/gocombine/pkg/parser/choice" "github.com/flier/gocombine/pkg/parser/combinator" "github.com/flier/gocombine/pkg/parser/errors" ) func main() { p := choice.Or(combinator.Ignore(char.Char('a')), errors.Unexpected[rune]("token")) fmt.Println(p([]rune("b"))) }
Output: <nil> [98] or, 2 errors occurred: * ignore, char, expected 'a', actual 'b', unexpected * token, unexpected
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.