mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't dereference the text of tok::eof, because it is usually empty. Use
string comparison instead. Swift SVN r6692
This commit is contained in:
@@ -465,10 +465,10 @@ bool Parser::parseList(tok RightK, SourceLoc LeftLoc, SourceLoc &RightLoc,
|
||||
Invalid |= callback();
|
||||
if (Tok.is(RightK))
|
||||
break;
|
||||
// If the lexer stopped with an EOF token whose spelling is ')', then this
|
||||
// If the lexer stopped with an EOF token whose spelling is ")", then this
|
||||
// is actually the tuple that is a string literal interpolation context.
|
||||
// Just accept the ) and build the tuple as we usually do.
|
||||
if (Tok.is(tok::eof) && Tok.getText()[0] == ')') {
|
||||
// Just accept the ")" and build the tuple as we usually do.
|
||||
if (Tok.is(tok::eof) && Tok.getText() == ")") {
|
||||
RightLoc = Tok.getLoc();
|
||||
return Invalid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user