Documentation ¶
Index ¶
- Variables
- func CheckParameterTypeName(typeName string) error
- func CompareParameterTypeMatchers(a, b *ParameterTypeMatcher) int
- func CompareParameterTypes(pt1, pt2 *ParameterType) int
- func NewAmbiguousParameterTypeError(parameterTypeRegexp, expressionRegexp string, parameterTypes []*ParameterType, ...) error
- func NewCucumberExpressionError(text string) error
- func NewUndefinedParameterTypeError(typeName string) error
- type AmbiguousParameterTypeError
- type Argument
- type BuiltInParameterTransformer
- type CombinatorialGeneratedExpressionFactory
- type CucumberExpression
- type CucumberExpressionError
- type CucumberExpressionGenerator
- type Expression
- type GeneratedExpression
- type GeneratedExpressionList
- type Group
- type GroupBuilder
- func (g *GroupBuilder) Add(groupBuilder *GroupBuilder)
- func (g *GroupBuilder) Build(submatches []*Submatch, indexIterator *IntIterator) *Group
- func (g *GroupBuilder) Capturing() bool
- func (g *GroupBuilder) Children() []*GroupBuilder
- func (g *GroupBuilder) MoveChildrenTo(groupBuilder *GroupBuilder)
- func (g *GroupBuilder) SetNonCapturing()
- func (g *GroupBuilder) SetSource(value string)
- func (g *GroupBuilder) Source() string
- type GroupBuilderStack
- type IntIterator
- type IntStack
- type InterfaceIterator
- type InterfaceStack
- type ParameterByTypeTransformer
- type ParameterType
- type ParameterTypeMatcher
- type ParameterTypeRegistry
- func (p *ParameterTypeRegistry) DefineParameterType(parameterType *ParameterType) error
- func (p *ParameterTypeRegistry) LookupByRegexp(parameterTypeRegexp string, expressionRegexp string, text string) (*ParameterType, error)
- func (p *ParameterTypeRegistry) LookupByTypeName(name string) *ParameterType
- func (p *ParameterTypeRegistry) ParameterTypes() []*ParameterType
- type RegularExpression
- type Submatch
- type TreeRegexp
- type UndefinedParameterTypeError
Constants ¶
This section is empty.
Variables ¶
View Source
var ALTERNATIVE_NON_WHITESPACE_TEXT_REGEXP = regexp.MustCompile(`([^\s^/]+)((/[^\s^/]+)+)`)
View Source
var ANONYMOUS_REGEXPS = `.*`
View Source
var DOUBLE_ESCAPE = `\\\\`
View Source
var ESCAPE_REGEXP = regexp.MustCompile(`([\\^[$.|?*+])`)
View Source
var FLOAT_REGEXPS = []*regexp.Regexp{ regexp.MustCompile(`-?\d*\.\d+`), }
View Source
var HAS_FLAG_REGEXP = regexp.MustCompile(`\(\?[imsU-]+(:.*)?\)`)
View Source
var ILLEGAL_PARAMETER_NAME_REGEXP = regexp.MustCompile(`([\[\]()$.|?*+])`)
View Source
var INTEGER_REGEXPS = []*regexp.Regexp{ regexp.MustCompile(`-?\d+`), regexp.MustCompile(`\d+`), }
View Source
var OPTIONAL_REGEXP = regexp.MustCompile(`(\\\\\\\\)?\([^)]+\)`)
View Source
var PARAMETER_REGEXP = regexp.MustCompile(`(\\\\\\\\)?{([^}]*)}`)
View Source
var STRING_REGEXPS = []*regexp.Regexp{ regexp.MustCompile(`"([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'`), }
View Source
var UNESCAPE_REGEXP = regexp.MustCompile(`(\\([\[$.|?*+\]]))`)
View Source
var WORD_REGEXPS = []*regexp.Regexp{ regexp.MustCompile(`[^\s]+`), }
Functions ¶
func CheckParameterTypeName ¶
func CompareParameterTypeMatchers ¶
func CompareParameterTypeMatchers(a, b *ParameterTypeMatcher) int
func CompareParameterTypes ¶
func CompareParameterTypes(pt1, pt2 *ParameterType) int
func NewAmbiguousParameterTypeError ¶
func NewAmbiguousParameterTypeError(parameterTypeRegexp, expressionRegexp string, parameterTypes []*ParameterType, generatedExpressions []*GeneratedExpression) error
Types ¶
type AmbiguousParameterTypeError ¶
type AmbiguousParameterTypeError struct {
// contains filtered or unexported fields
}
func (*AmbiguousParameterTypeError) Error ¶
func (e *AmbiguousParameterTypeError) Error() string
type Argument ¶
type Argument struct {
// contains filtered or unexported fields
}
func BuildArguments ¶
func BuildArguments(treeRegexp *TreeRegexp, text string, parameterTypes []*ParameterType) []*Argument
func NewArgument ¶
func NewArgument(group *Group, parameterType *ParameterType) *Argument
func (*Argument) ParameterType ¶
func (a *Argument) ParameterType() *ParameterType
type BuiltInParameterTransformer ¶
type BuiltInParameterTransformer struct { }
func (BuiltInParameterTransformer) Transform ¶
func (s BuiltInParameterTransformer) Transform(fromValue string, toValueType interface{}) (interface{}, error)
type CombinatorialGeneratedExpressionFactory ¶
type CombinatorialGeneratedExpressionFactory struct {
// contains filtered or unexported fields
}
func NewCombinatorialGeneratedExpressionFactory ¶
func NewCombinatorialGeneratedExpressionFactory(expressionTemplate string, parameterTypeCombinations [][]*ParameterType) *CombinatorialGeneratedExpressionFactory
func (*CombinatorialGeneratedExpressionFactory) GenerateExpressions ¶
func (c *CombinatorialGeneratedExpressionFactory) GenerateExpressions() []*GeneratedExpression
type CucumberExpression ¶
type CucumberExpression struct {
// contains filtered or unexported fields
}
func NewCucumberExpression ¶
func NewCucumberExpression(expression string, parameterTypeRegistry *ParameterTypeRegistry) (*CucumberExpression, error)
func (*CucumberExpression) Regexp ¶
func (c *CucumberExpression) Regexp() *regexp.Regexp
func (*CucumberExpression) Source ¶
func (c *CucumberExpression) Source() string
type CucumberExpressionError ¶
type CucumberExpressionError struct {
// contains filtered or unexported fields
}
func (*CucumberExpressionError) Error ¶
func (e *CucumberExpressionError) Error() string
type CucumberExpressionGenerator ¶
type CucumberExpressionGenerator struct {
// contains filtered or unexported fields
}
func NewCucumberExpressionGenerator ¶
func NewCucumberExpressionGenerator(parameterTypeRegistry *ParameterTypeRegistry) *CucumberExpressionGenerator
func (*CucumberExpressionGenerator) GenerateExpressions ¶
func (c *CucumberExpressionGenerator) GenerateExpressions(text string) []*GeneratedExpression
type Expression ¶
type GeneratedExpression ¶
type GeneratedExpression struct {
// contains filtered or unexported fields
}
func NewGeneratedExpression ¶
func NewGeneratedExpression(expressionTemplate string, parameterTypes []*ParameterType) *GeneratedExpression
func (*GeneratedExpression) ParameterNames ¶
func (g *GeneratedExpression) ParameterNames() []string
func (*GeneratedExpression) ParameterTypes ¶
func (g *GeneratedExpression) ParameterTypes() []*ParameterType
func (*GeneratedExpression) Source ¶
func (g *GeneratedExpression) Source() string
type GeneratedExpressionList ¶
type GeneratedExpressionList struct {
// contains filtered or unexported fields
}
func (*GeneratedExpressionList) Push ¶
func (g *GeneratedExpressionList) Push(expr *GeneratedExpression)
func (*GeneratedExpressionList) ToArray ¶
func (g *GeneratedExpressionList) ToArray() []*GeneratedExpression
type GroupBuilder ¶
type GroupBuilder struct {
// contains filtered or unexported fields
}
func NewGroupBuilder ¶
func NewGroupBuilder() *GroupBuilder
func (*GroupBuilder) Add ¶
func (g *GroupBuilder) Add(groupBuilder *GroupBuilder)
func (*GroupBuilder) Build ¶
func (g *GroupBuilder) Build(submatches []*Submatch, indexIterator *IntIterator) *Group
func (*GroupBuilder) Capturing ¶
func (g *GroupBuilder) Capturing() bool
func (*GroupBuilder) Children ¶
func (g *GroupBuilder) Children() []*GroupBuilder
func (*GroupBuilder) MoveChildrenTo ¶
func (g *GroupBuilder) MoveChildrenTo(groupBuilder *GroupBuilder)
func (*GroupBuilder) SetNonCapturing ¶
func (g *GroupBuilder) SetNonCapturing()
func (*GroupBuilder) SetSource ¶
func (g *GroupBuilder) SetSource(value string)
func (*GroupBuilder) Source ¶
func (g *GroupBuilder) Source() string
type GroupBuilderStack ¶
type GroupBuilderStack struct {
// contains filtered or unexported fields
}
func (*GroupBuilderStack) Len ¶
func (s *GroupBuilderStack) Len() int
func (*GroupBuilderStack) Peek ¶
func (s *GroupBuilderStack) Peek() *GroupBuilder
func (*GroupBuilderStack) Pop ¶
func (s *GroupBuilderStack) Pop() *GroupBuilder
func (*GroupBuilderStack) Push ¶
func (s *GroupBuilderStack) Push(value *GroupBuilder)
type IntIterator ¶
type IntIterator struct {
// contains filtered or unexported fields
}
func NewIntIterator ¶
func NewIntIterator(size int) *IntIterator
func (*IntIterator) Next ¶
func (s *IntIterator) Next() int
type InterfaceIterator ¶
type InterfaceIterator struct {
// contains filtered or unexported fields
}
func (*InterfaceIterator) Next ¶
func (i *InterfaceIterator) Next() interface{}
type InterfaceStack ¶
type InterfaceStack struct {
// contains filtered or unexported fields
}
func (*InterfaceStack) Len ¶
func (i *InterfaceStack) Len() int
func (*InterfaceStack) Peek ¶
func (i *InterfaceStack) Peek() interface{}
func (*InterfaceStack) Pop ¶
func (i *InterfaceStack) Pop() interface{}
func (*InterfaceStack) Push ¶
func (i *InterfaceStack) Push(value interface{})
type ParameterType ¶
type ParameterType struct {
// contains filtered or unexported fields
}
func NewParameterType ¶
func (*ParameterType) Name ¶
func (p *ParameterType) Name() string
func (*ParameterType) PreferForRegexpMatch ¶
func (p *ParameterType) PreferForRegexpMatch() bool
func (*ParameterType) Regexps ¶
func (p *ParameterType) Regexps() []*regexp.Regexp
func (*ParameterType) Transform ¶
func (p *ParameterType) Transform(groupValues []*string) interface{}
func (*ParameterType) Type ¶
func (p *ParameterType) Type() string
func (*ParameterType) UseForSnippets ¶
func (p *ParameterType) UseForSnippets() bool
type ParameterTypeMatcher ¶
type ParameterTypeMatcher struct {
// contains filtered or unexported fields
}
func NewParameterTypeMatcher ¶
func NewParameterTypeMatcher(parameterType *ParameterType, r *regexp.Regexp, text string, matchPosition int) *ParameterTypeMatcher
func (*ParameterTypeMatcher) AdvanceTo ¶
func (p *ParameterTypeMatcher) AdvanceTo(newMatchPosition int) *ParameterTypeMatcher
func (*ParameterTypeMatcher) Find ¶
func (p *ParameterTypeMatcher) Find() bool
func (*ParameterTypeMatcher) Group ¶
func (p *ParameterTypeMatcher) Group() string
func (*ParameterTypeMatcher) ParameterType ¶
func (p *ParameterTypeMatcher) ParameterType() *ParameterType
func (*ParameterTypeMatcher) Start ¶
func (p *ParameterTypeMatcher) Start() int
type ParameterTypeRegistry ¶
type ParameterTypeRegistry struct {
// contains filtered or unexported fields
}
func NewParameterTypeRegistry ¶
func NewParameterTypeRegistry() *ParameterTypeRegistry
func (*ParameterTypeRegistry) DefineParameterType ¶
func (p *ParameterTypeRegistry) DefineParameterType(parameterType *ParameterType) error
func (*ParameterTypeRegistry) LookupByRegexp ¶
func (p *ParameterTypeRegistry) LookupByRegexp(parameterTypeRegexp string, expressionRegexp string, text string) (*ParameterType, error)
func (*ParameterTypeRegistry) LookupByTypeName ¶
func (p *ParameterTypeRegistry) LookupByTypeName(name string) *ParameterType
func (*ParameterTypeRegistry) ParameterTypes ¶
func (p *ParameterTypeRegistry) ParameterTypes() []*ParameterType
type RegularExpression ¶
type RegularExpression struct {
// contains filtered or unexported fields
}
func NewRegularExpression ¶
func NewRegularExpression(expressionRegexp *regexp.Regexp, parameterTypeRegistry *ParameterTypeRegistry) *RegularExpression
func (*RegularExpression) Regexp ¶
func (r *RegularExpression) Regexp() *regexp.Regexp
func (*RegularExpression) Source ¶
func (r *RegularExpression) Source() string
type TreeRegexp ¶
type TreeRegexp struct {
// contains filtered or unexported fields
}
func NewTreeRegexp ¶
func NewTreeRegexp(regexp *regexp.Regexp) *TreeRegexp
func (*TreeRegexp) GroupBuilder ¶
func (t *TreeRegexp) GroupBuilder() *GroupBuilder
func (*TreeRegexp) Match ¶
func (t *TreeRegexp) Match(s string) *Group
func (*TreeRegexp) Regexp ¶
func (t *TreeRegexp) Regexp() *regexp.Regexp
type UndefinedParameterTypeError ¶
type UndefinedParameterTypeError struct {
// contains filtered or unexported fields
}
func (*UndefinedParameterTypeError) Error ¶
func (e *UndefinedParameterTypeError) Error() string
Source Files ¶
- argument.go
- combinatorial_generated_expression_factory.go
- cucumber_expression.go
- cucumber_expression_generator.go
- errors.go
- expression.go
- generated_expression.go
- group.go
- group_builder.go
- iterator.go
- parameter_by_type_transformer.go
- parameter_type.go
- parameter_type_matcher.go
- parameter_type_registry.go
- regular_expression.go
- stack.go
- submatch.go
- tree_regexp.go
Click to show internal directories.
Click to hide internal directories.