public GherkinDialect GetGherkinDialect(Feature feature) { string langName = feature.Language ?? defaultLanguage.Name; var language = SupportedLanguageHelper.GetSupportedLanguage(langName); return(GetGherkinDialect(language)); }
internal LanguageInfo GetLanguage(string fileContent) { string langName = defaultLanguage.Name; var langMatch = languageRe.Match(fileContent); if (langMatch.Success) { langName = langMatch.Groups["lang"].Value; } LanguageInfo languageInfo = SupportedLanguageHelper.GetSupportedLanguage(langName); return(languageInfo); }
internal LanguageInfo GetLanguage(Func <int, string> lineProvider) { string langName = defaultLanguage.Name; int lineNo = 0; string line; while ((line = lineProvider(lineNo++)) != null) { var langMatch = languageLineRe.Match(line); if (langMatch.Success) { langName = langMatch.Groups["lang"].Value; break; } if (line.Trim().Length != 0) { break; } } return(SupportedLanguageHelper.GetSupportedLanguage(langName)); }
public GherkinDialect GetDefaultDialect() { return(GetGherkinDialect(SupportedLanguageHelper.GetSupportedLanguage(defaultLanguage.Name))); }