Esempio n. 1
0
 Token MakeEndOfTest()
 {
     source.Start();
     source.MoveWhile(() => source.Type != CharacterType.End && source.Type != CharacterType.BeginTest);
     if (source.Type == CharacterType.End)
     {
         return(new Token(TokenType.End, source.FromStart));
     }
     source.MoveNext();
     return(new Token(TokenType.Leader, source.FromStart));
 }
        Token MakeEndOfTest()
        {
            var content = source.Until(() => source.Type == CharacterType.BeginTest);

            if (source.AtEnd)
            {
                return(new Token(TokenType.End, content));
            }
            content += source.Content;
            source.MoveNext();
            return(new Token(TokenType.Leader, content));
        }