convert TokenKind to a scoped enum, eliminating the old c++'98 hackaround to

emulate it.


Swift SVN r442
This commit is contained in:
Chris Lattner
2011-07-24 19:28:36 +00:00
parent 3a059605e7
commit 6fbe70dd87
5 changed files with 60 additions and 64 deletions

View File

@@ -68,7 +68,7 @@ SMLoc Parser::consumeToken() {
/// Because we cannot guarantee that the token will ever occur, this skips to
/// some likely good stopping point.
///
void Parser::skipUntil(tok::TokenKind T) {
void Parser::skipUntil(tok T) {
// tok::unknown is a sentinel that means "don't skip".
if (T == tok::unknown) return;
@@ -104,8 +104,7 @@ bool Parser::parseIdentifier(Identifier &Result, const Twine &Message) {
/// If the input is malformed, this emits the specified error diagnostic.
/// Next, if SkipToTok is specified, it calls skipUntil(SkipToTok). Finally,
/// true is returned.
bool Parser::parseToken(tok::TokenKind K, const char *Message,
tok::TokenKind SkipToTok) {
bool Parser::parseToken(tok K, const char *Message, tok SkipToTok) {
if (Tok.is(K)) {
consumeToken(K);
return false;