parser

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2017 License: GPL-3.0, GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToStepText

func ConvertToStepText(fragments []*gauge_messages.Fragment) string

func CreateStepFromStepRequest

func CreateStepFromStepRequest(stepReq *gauge_messages.ExecuteStepRequest) *gauge.Step

func CreateStepValue

func CreateStepValue(step *gauge.Step) gauge.StepValue

func ExtractStepArgsFromToken added in v0.9.1

func ExtractStepArgsFromToken(stepToken *Token) ([]gauge.StepArg, error)

func ExtractStepValueAndParams

func ExtractStepValueAndParams(stepText string, hasInlineTable bool) (*gauge.StepValue, error)

func FilterTableRelatedScenarios added in v0.8.5

func FilterTableRelatedScenarios(scenarios []*gauge.Scenario, fun func(*gauge.Scenario) bool) (otherScenarios, tableRelatedScenarios []*gauge.Scenario)

func GetSpecsForDataTableRows added in v0.8.4

func GetSpecsForDataTableRows(s []*gauge.Specification, errMap *gauge.BuildErrors) (specs []*gauge.Specification)

Creates a spec for each data table row

func GetUnescapedString

func GetUnescapedString(string1 string) string

func HandleParseResult

func HandleParseResult(results ...*ParseResult) bool

func ParseSpecs added in v0.6.2

func ParseSpecs(args []string, conceptsDictionary *gauge.ConceptDictionary, buildErrors *gauge.BuildErrors) ([]*gauge.Specification, bool)

func PopulateConceptDynamicParams

func PopulateConceptDynamicParams(concept *gauge.Step, dataTableLookup *gauge.ArgLookup)

Creating a copy of the lookup and populating table values

func TableFrom

func TableFrom(protoTable *gauge_messages.ProtoTable) *gauge.Table

Types

type ConceptParser

type ConceptParser struct {
	// contains filtered or unexported fields
}

func (*ConceptParser) Parse

func (parser *ConceptParser) Parse(text, fileName string) ([]*gauge.Step, *ParseResult)

concept file can have multiple concept headings

func (*ConceptParser) ParseFile added in v0.1.8

func (parser *ConceptParser) ParseFile(file string) ([]*gauge.Step, *ParseResult)

type ParamResolver

type ParamResolver struct {
}

func (*ParamResolver) GetResolvedParams

func (paramResolver *ParamResolver) GetResolvedParams(step *gauge.Step, parent *gauge.Step, lookup *gauge.ArgLookup) []*gauge_messages.Parameter

type ParseError

type ParseError struct {
	FileName string
	LineNo   int
	Message  string
	LineText string
}

func AddConcepts

func AddConcepts(conceptFiles []string, conceptDictionary *gauge.ConceptDictionary) ([]*gauge.Step, []ParseError)

func (ParseError) Error

func (se ParseError) Error() string

type ParseResult

type ParseResult struct {
	ParseErrors    []ParseError
	CriticalErrors []ParseError
	Warnings       []*Warning
	Ok             bool
	FileName       string
}

func CreateConceptsDictionary

func CreateConceptsDictionary() (*gauge.ConceptDictionary, *ParseResult)

func CreateStepUsingLookup added in v0.3.2

func CreateStepUsingLookup(stepToken *Token, lookup *gauge.ArgLookup, specFileName string) (*gauge.Step, *ParseResult)

func ParseConcepts added in v0.6.2

func ParseConcepts() (*gauge.ConceptDictionary, *ParseResult)

func ParseSpecFiles

func ParseSpecFiles(specFiles []string, conceptDictionary *gauge.ConceptDictionary, buildErrors *gauge.BuildErrors) ([]*gauge.Specification, []*ParseResult)

TODO: Use single channel instead of one for spec and another for result, so that mapping is consistent

func (*ParseResult) Errors added in v0.5.0

func (result *ParseResult) Errors() []string

type SpecParser

type SpecParser struct {
	// contains filtered or unexported fields
}

func (*SpecParser) CreateSpecification

func (parser *SpecParser) CreateSpecification(tokens []*Token, conceptDictionary *gauge.ConceptDictionary, specFile string) (*gauge.Specification, *ParseResult)

func (*SpecParser) GenerateTokens

func (parser *SpecParser) GenerateTokens(specText, fileName string) ([]*Token, []ParseError)

func (*SpecParser) Parse

func (parser *SpecParser) Parse(specText string, conceptDictionary *gauge.ConceptDictionary, specFile string) (*gauge.Specification, *ParseResult)

type Token

type Token struct {
	Kind     gauge.TokenKind
	LineNo   int
	LineText string
	Suffix   string
	Args     []string
	Value    string
}

func (*Token) String

func (token *Token) String() string

type Warning

type Warning struct {
	FileName string
	LineNo   int
	Message  string
}

func (*Warning) String

func (warning *Warning) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL