@@ -321,10 +321,10 @@ class Parser {
321
321
void restoreParserPosition (ParserPosition PP) {
322
322
L->restoreState (PP.LS );
323
323
324
- // We might be at tok::eof now, so ensure that consumeLoc ()
324
+ // We might be at tok::eof now, so ensure that consumeToken ()
325
325
// does not assert about lexing past eof.
326
326
Tok = syntax::Token::unknown ();
327
- consumeLoc ();
327
+ consumeToken ();
328
328
329
329
PreviousLoc = PP.PreviousLoc ;
330
330
}
@@ -334,10 +334,10 @@ class Parser {
334
334
335
335
L->backtrackToState (PP.LS );
336
336
337
- // We might be at tok::eof now, so ensure that consumeLoc ()
337
+ // We might be at tok::eof now, so ensure that consumeToken ()
338
338
// does not assert about lexing past eof.
339
339
Tok = syntax::Token::unknown ();
340
- consumeLoc ();
340
+ consumeToken ();
341
341
342
342
PreviousLoc = PP.PreviousLoc ;
343
343
}
@@ -386,22 +386,21 @@ class Parser {
386
386
// ===--------------------------------------------------------------------===//
387
387
// Utilities
388
388
389
- // / \brief Return the next token that will be installed by \c consumeLoc .
389
+ // / \brief Return the next token that will be installed by \c consumeToken .
390
390
const syntax::Token &peekToken ();
391
391
392
- syntax::Token consumeToken ();
393
- SourceLoc consumeLoc ();
394
- SourceLoc consumeLoc (tok K) {
392
+ SourceLoc consumeToken ();
393
+ SourceLoc consumeToken (tok K) {
395
394
assert (Tok.is (K) && " Consuming wrong token kind" );
396
- return consumeLoc ();
395
+ return consumeToken ();
397
396
}
398
397
399
398
SourceLoc consumeIdentifier (Identifier *Result = nullptr ) {
400
399
assert (Tok.isAny (tok::identifier, tok::kw_self,
401
400
tok::kw_Self, tok::kw_throws));
402
401
if (Result)
403
402
*Result = Context.getIdentifier (Tok.getText ().str ());
404
- return consumeLoc ();
403
+ return consumeToken ();
405
404
}
406
405
407
406
// / \brief Retrieve the location just past the end of the previous
@@ -412,15 +411,15 @@ class Parser {
412
411
// / return true. Otherwise, return false without consuming it.
413
412
bool consumeIf (tok K) {
414
413
if (Tok.isNot (K)) return false ;
415
- consumeLoc (K);
414
+ consumeToken (K);
416
415
return true ;
417
416
}
418
417
419
418
// / \brief If the current token is the specified kind, consume it and
420
419
// / return true. Otherwise, return false without consuming it.
421
420
bool consumeIf (tok K, SourceLoc &consumedLoc) {
422
421
if (Tok.isNot (K)) return false ;
423
- consumedLoc = consumeLoc (K);
422
+ consumedLoc = consumeToken (K);
424
423
return true ;
425
424
}
426
425
0 commit comments