private Token Consume(TokenKind kind) { Token old = current; current = lexer.Next(); if (old.Kind != kind) throw new ParseException("Unexpected token: " + current.Kind.ToString() + ". Was expecting: " + kind, current.Line, current.Column); return old; }
private Token Consume() { Token old = current; current = lexer.Next(); return old; }