Esempio n. 1
0
        public bool Match_Comment(Token token)
        {
            if (!token.IsEOF && token.Line.StartsWith("#"))
            {
                token.MatchedType = TokenType.Comment;
                token.Text        = token.Line.GetRestTrimmed(0).Substring(1);

                if (languageChangeAllowed && token.Text.StartsWith(LANGUAGE_PREFIX, StringComparison.OrdinalIgnoreCase))
                {
                    var language = token.Text.Substring(LANGUAGE_PREFIX.Length).Trim();
                    currentDialect = dialectProvider.GetDialect(language);
                }
                languageChangeAllowed = false;

                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        public bool Match_Comment(Token token)
        {
            if (!token.IsEOF && token.Line.StartsWith("#"))
            {
                token.MatchedType = TokenType.Comment;
                token.Text = token.Line.GetRestTrimmed(0).Substring(1);

                if (languageChangeAllowed && token.Text.StartsWith(LANGUAGE_PREFIX, StringComparison.OrdinalIgnoreCase))
                {
                    var language = token.Text.Substring(LANGUAGE_PREFIX.Length).Trim();
                    currentDialect = dialectProvider.GetDialect(language);
                }
                languageChangeAllowed = false;

                return true;
            }
            return false;
        }
Esempio n. 3
0
        public TokenMatcher(GherkinDialectProvider dialectProvider = null)
        {
            this.dialectProvider = dialectProvider ?? new GherkinDialectProvider();

            currentDialect = this.dialectProvider.DefaultDialect;
        }
Esempio n. 4
0
 public GherkinDialectProvider(string defaultLanguage = "en")
 {
     defaultDialect = GetDialect(defaultLanguage);
 }
Esempio n. 5
0
 public GherkinDialectProvider(string defaultLanguage = "en")
 {
     defaultDialect = GetDialect(defaultLanguage);
 }
Esempio n. 6
0
        public TokenMatcher(GherkinDialectProvider dialectProvider = null)
        {
            this.dialectProvider = dialectProvider ?? new GherkinDialectProvider();

            currentDialect = this.dialectProvider.DefaultDialect;
        }