Exemplo n.º 1
0
        private bool IsKeyWord(string line, out string formatted_line, out TokenType keywordType)
        {
            formatted_line = "";
            keywordType    = TokenType.Other;
            Token token = ToToken(line);

            if (TokenMatcher.Match_FeatureLine(token) ||
                TokenMatcher.Match_ScenarioLine(token) ||
                TokenMatcher.Match_ScenarioOutlineLine(token) ||
                TokenMatcher.Match_BackgroundLine(token))
            {
                string keyword = token.MatchedKeyword;
                keywordType    = token.MatchedType;
                formatted_line = keyword + ": " + token.MatchedText;
                return(true);
            }
            if (TokenMatcher.Match_ExamplesLine(token))
            {
                string keyword = token.MatchedKeyword;
                keywordType    = token.MatchedType;
                formatted_line = IDENT2 + keyword + ": " + token.MatchedText;
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public Token ParseToken(string line)
        {
            Token token = ToToken(line);

            if (TokenMatcher.Match_FeatureLine(token) ||
                TokenMatcher.Match_ScenarioLine(token) ||
                TokenMatcher.Match_ScenarioOutlineLine(token) ||
                TokenMatcher.Match_BackgroundLine(token) ||
                TokenMatcher.Match_ExamplesLine(token) ||
                TokenMatcher.Match_StepLine(token) ||
                TokenMatcher.Match_TagLine(token) ||
                TokenMatcher.Match_TableRow(token) ||
                SimpleMatchLanguage(token) ||
                TokenMatcher.Match_DocStringSeparator(token))
            {
                return(token);
            }

            return(token);
        }
Exemplo n.º 3
0
        private bool IsKeyWord(string line, out TokenType keywordType)
        {
            keywordType = TokenType.Other;
            Token token = ToToken(line);

            if (TokenMatcher.Match_FeatureLine(token) ||
                TokenMatcher.Match_ScenarioLine(token) ||
                TokenMatcher.Match_ScenarioOutlineLine(token) ||
                TokenMatcher.Match_BackgroundLine(token) ||
                TokenMatcher.Match_ExamplesLine(token))
            {
                string keyword = token.MatchedKeyword;
                keywordType = token.MatchedType;

                if (keywordType == TokenType.FeatureLine)
                {
                    NotifyCurrentGherkinLanguage(token.MatchedGherkinDialect.Language);
                }

                return(true);
            }

            return(false);
        }