Documentation ¶
Index ¶
- Variables
- type CommitType
- type GeneratorOptions
- type Node
- type ParseError
- type SequenceItem
- type Syntax
- func (s *Syntax) AnyChar(name string, ct CommitType) error
- func (s *Syntax) CharSequence(name string, ct CommitType, chars []rune) error
- func (s *Syntax) Choice(name string, ct CommitType, options ...string) error
- func (s *Syntax) Class(name string, ct CommitType, not bool, chars []rune, ranges [][]rune) error
- func (s *Syntax) Generate(o GeneratorOptions, w io.Writer) error
- func (s *Syntax) Init() error
- func (s *Syntax) Parse(r io.Reader) (*Node, error)
- func (s *Syntax) ReadSyntax(r io.Reader) error
- func (s *Syntax) Sequence(name string, ct CommitType, items ...SequenceItem) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSyntaxInitialized = errors.New("syntax initialized") ErrInitFailed = errors.New("init failed") ErrNoParsersDefined = errors.New("no parsers defined") ErrInvalidEscapeCharacter = errors.New("invalid escape character") ErrMultipleRoots = errors.New("multiple roots") ErrInvalidSymbolName = errors.New("invalid symbol name") )
View Source
var ErrInvalidUnicodeCharacter = errors.New("invalid unicode character")
Functions ¶
This section is empty.
Types ¶
type CommitType ¶
type CommitType int
const ( None CommitType = 0 Alias CommitType = 1 << iota Whitespace NoWhitespace Keyword NoKeyword FailPass Root )
func (CommitType) String ¶
func (ct CommitType) String() string
type GeneratorOptions ¶
type Node ¶
type ParseError ¶
type ParseError struct { // Input is the name of the input file or <input> if not // available. Input string // Offset is the index of the right-most failing // token in the input text. Offset int // Line tells the line index of the right-most failing // token in the input text. // // It is zero-based, and for error reporting, it is // recommended to increment it by one. Line int // Column tells the column index of the right-most failing // token in the input text. Column int // Definition tells the right-most unmatched parser definition. Definition string }
ParseError is returned when the input text doesn't match the used syntax during parsing.
func (*ParseError) Error ¶
func (pe *ParseError) Error() string
type SequenceItem ¶
if min=0&&max=0, it means min=1,max=1 else if max<=0, it means no max else if min<=0, it means no min
type Syntax ¶
type Syntax struct {
// contains filtered or unexported fields
}
func (*Syntax) CharSequence ¶
func (s *Syntax) CharSequence(name string, ct CommitType, chars []rune) error
func (*Syntax) Choice ¶
func (s *Syntax) Choice(name string, ct CommitType, options ...string) error
func (*Syntax) Sequence ¶
func (s *Syntax) Sequence(name string, ct CommitType, items ...SequenceItem) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.