Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotACommand = errors.New("not a command")
ErrNotACommand is the error returned when the string to be parsed does not represent a command syntactically
var ErrTokenizeError = errors.New("error tokenizing")
ErrTokenizeError represents an error tokenizing where there was an opening quote without a paired closing
var ErrUnknownCommand = errors.New("unknown command")
ErrUnknownCommand is the error returned when the string to be parsed is a command syntactically but that command is not registered
Functions ¶
func MaybeCount ¶
MaybeCount attempts to split some text that might contain a "count" at the end
Recognized "count" format is a string of digits, possibly preceded by an x, +, or -, preceeded by a space
Types ¶
type Options ¶
Options specifies options when constructing a new Parser
- CmdIndicator is the string that all commands must be prefixed with (e.g., "!" or "/") - KnownCommands is a list of commands that should be recognized (expanded with LearnCommand) - CaseSensitive will make the parser case-sensitive when determining if it knows about a command