Example #1
0
        public TokenInfo?NextToken()
        {
            switch (_currentChar)
            {
            case char.MaxValue:
                return(null);

            case '@':
                var at = new TokenInfo(TokenKind.At, "@", _rawString.Forward..(_rawString.Forward + 1));
                _rawString.Advance();
                return(at);

            case '{':
                var lBrace = new TokenInfo(TokenKind.LBrace, "{", _rawString.Forward..(_rawString.Forward + 1));
                _rawString.Advance();
                return(lBrace);

            case '}':
                var rBrace = new TokenInfo(TokenKind.RBrace, "}", _rawString.Forward..(_rawString.Forward + 1));
                _rawString.Advance();
                return(rBrace);

            case ':':
                var colon = new TokenInfo(TokenKind.Colon, ":", _rawString.Forward..(_rawString.Forward + 1));
                _rawString.Advance();
                return(colon);

            default:
                return(PlainText());
            }
        }