예제 #1
0
        public static string Consume(this AbstractLexer lexer, params TokenKind[] kinds)
        {
            lexer.VerifyToken(kinds);

            var result = lexer.Token.Text;

            lexer.Advance();

            return(result);
        }
예제 #2
0
        public static string Consume(this AbstractLexer lexer, TokenKind kind, string text = null)
        {
            lexer.VerifyToken(kind, text);

            var result = lexer.Token.Text;

            lexer.Advance();

            return(result);
        }