本文整理匯總了Golang中github.com/getgauge/gauge/parser.CreateConceptsDictionary函數的典型用法代碼示例。如果您正苦於以下問題:Golang CreateConceptsDictionary函數的具體用法?Golang CreateConceptsDictionary怎麽用?Golang CreateConceptsDictionary使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了CreateConceptsDictionary函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: PerformRephraseRefactoring
func PerformRephraseRefactoring(oldStep, newStep string, startChan *runner.StartChannels) *refactoringResult {
defer killRunner(startChan)
if newStep == oldStep {
return &refactoringResult{Success: true}
}
agent, err := getRefactorAgent(oldStep, newStep, startChan)
if err != nil {
return rephraseFailure(err.Error())
}
result := &refactoringResult{Success: true, Errors: make([]string, 0), warnings: make([]string, 0)}
specs, specParseResults := parser.FindSpecs(filepath.Join(config.ProjectRoot, common.SpecsDirectoryName), &parser.ConceptDictionary{})
addErrorsAndWarningsToRefactoringResult(result, specParseResults...)
if !result.Success {
return result
}
conceptDictionary, parseResult := parser.CreateConceptsDictionary(false)
addErrorsAndWarningsToRefactoringResult(result, parseResult)
if !result.Success {
return result
}
refactorResult := agent.performRefactoringOn(specs, conceptDictionary)
refactorResult.warnings = append(refactorResult.warnings, result.warnings...)
return refactorResult
}
示例2: ExecuteSpecs
func ExecuteSpecs(inParallel bool, args []string) {
env.LoadEnv(false)
conceptsDictionary, conceptParseResult := parser.CreateConceptsDictionary(false)
parser.HandleParseResult(conceptParseResult)
specsToExecute, specsSkipped := filter.GetSpecsToExecute(conceptsDictionary, args)
if len(specsToExecute) == 0 {
printExecutionStatus(nil, 0)
}
parallelInfo := ¶llelInfo{inParallel: inParallel, numberOfStreams: NumberOfExecutionStreams}
if !parallelInfo.isValid() {
os.Exit(1)
}
manifest, err := manifest.ProjectManifest()
if err != nil {
execLogger.CriticalError(err)
}
runner := startApi()
validateSpecs(manifest, specsToExecute, runner, conceptsDictionary)
pluginHandler := plugin.StartPlugins(manifest)
execution := newExecution(manifest, specsToExecute, runner, pluginHandler, parallelInfo, execLogger.Current())
result := execution.start()
execution.finish()
exitCode := printExecutionStatus(result, specsSkipped)
os.Exit(exitCode)
}
示例3: parseSpecs
func parseSpecs(args []string) ([]*parser.Specification, *parser.ConceptDictionary) {
conceptsDictionary, conceptParseResult := parser.CreateConceptsDictionary(false)
parser.HandleParseResult(conceptParseResult)
specsToExecute, _ := filter.GetSpecsToExecute(conceptsDictionary, args)
if len(specsToExecute) == 0 {
printExecutionStatus(nil, &validationErrMaps{})
}
return specsToExecute, conceptsDictionary
}
示例4: parseSpecs
func parseSpecs(args []string) ([]*gauge.Specification, *gauge.ConceptDictionary) {
conceptsDictionary, conceptParseResult := parser.CreateConceptsDictionary(false, args)
parser.HandleParseResult(conceptParseResult)
specsToExecute, _ := filter.GetSpecsToExecute(conceptsDictionary, args)
if len(specsToExecute) == 0 {
logger.Info("No specifications found in %s.", strings.Join(args, ", "))
os.Exit(0)
}
return specsToExecute, conceptsDictionary
}
示例5: PerformRephraseRefactoring
func PerformRephraseRefactoring(oldStep, newStep string, startChan *runner.StartChannels, specDirs []string) *refactoringResult {
defer killRunner(startChan)
if newStep == oldStep {
return &refactoringResult{Success: true}
}
agent, err := getRefactorAgent(oldStep, newStep, startChan)
if err != nil {
return rephraseFailure(err.Error())
}
result := &refactoringResult{Success: true, Errors: make([]string, 0), warnings: make([]string, 0)}
var specs []*gauge.Specification
var specParseResults []*parser.ParseResult
for _, dir := range specDirs {
specFiles := util.GetSpecFiles(filepath.Join(config.ProjectRoot, dir))
specSlice, specParseResultsSlice := parser.ParseSpecFiles(specFiles, &gauge.ConceptDictionary{})
specs = append(specs, specSlice...)
specParseResults = append(specParseResults, specParseResultsSlice...)
}
addErrorsAndWarningsToRefactoringResult(result, specParseResults...)
if !result.Success {
return result
}
conceptDictionary, parseResult := parser.CreateConceptsDictionary(false, specDirs)
addErrorsAndWarningsToRefactoringResult(result, parseResult)
if !result.Success {
return result
}
refactorResult := agent.performRefactoringOn(specs, conceptDictionary)
refactorResult.warnings = append(refactorResult.warnings, result.warnings...)
return refactorResult
}
示例6: createConceptsDictionary
func (s *SpecInfoGatherer) createConceptsDictionary() {
var result *parser.ParseResult
s.conceptDictionary, result = parser.CreateConceptsDictionary(true)
s.handleParseFailures([]*parser.ParseResult{result})
}
示例7: getParsedConcepts
func (s *SpecInfoGatherer) getParsedConcepts() map[string]*gauge.Concept {
var result *parser.ParseResult
s.conceptDictionary, result = parser.CreateConceptsDictionary(true)
s.handleParseFailures([]*parser.ParseResult{result})
return s.conceptDictionary.ConceptsMap
}