當前位置: 首頁>>代碼示例>>Golang>>正文


Golang parser.CreateConceptsDictionary函數代碼示例

本文整理匯總了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
}
開發者ID:ranjeet-floyd,項目名稱:gauge,代碼行數:28,代碼來源:refactor.go

示例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 := &parallelInfo{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)
}
開發者ID:ranjeet-floyd,項目名稱:gauge,代碼行數:25,代碼來源:execute.go

示例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
}
開發者ID:krwhitney,項目名稱:gauge,代碼行數:9,代碼來源:execute.go

示例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
}
開發者ID:mattdotmatt,項目名稱:gauge,代碼行數:10,代碼來源:validate.go

示例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
}
開發者ID:mattdotmatt,項目名稱:gauge,代碼行數:39,代碼來源:refactor.go

示例6: createConceptsDictionary

func (s *SpecInfoGatherer) createConceptsDictionary() {
	var result *parser.ParseResult
	s.conceptDictionary, result = parser.CreateConceptsDictionary(true)
	s.handleParseFailures([]*parser.ParseResult{result})
}
開發者ID:0-T-0,項目名稱:gauge,代碼行數:5,代碼來源:specDetails.go

示例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
}
開發者ID:0-T-0,項目名稱:gauge,代碼行數:6,代碼來源:specDetails.go


注:本文中的github.com/getgauge/gauge/parser.CreateConceptsDictionary函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。