Exemplo n.º 1
0
        public GherkinDialect GetGherkinDialect(Feature feature)
        {
            string langName = feature.Language ?? defaultLanguage.Name;
            var    language = SupportedLanguageHelper.GetSupportedLanguage(langName);

            return(GetGherkinDialect(language));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public GherkinDialect GetDefaultDialect()
 {
     return(GetGherkinDialect(SupportedLanguageHelper.GetSupportedLanguage(defaultLanguage.Name)));
 }