Skip to content

Commit 7949162

Browse files
committed
Parse: An empty escaped identifier is entirely whitespace
1 parent ff941bc commit 7949162

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Parse/Lexer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static bool advanceIfValidContinuationOfOperator(char const *&ptr,
661661
/// Returns true if the given string is entirely whitespace (considering only
662662
/// those whitespace code points permitted in raw identifiers).
663663
static bool isEntirelyWhitespace(StringRef string) {
664-
if (string.empty()) return false;
664+
if (string.empty()) return true;
665665
char const *p = string.data(), *end = string.end();
666666
if (!advanceIf(p, end, isPermittedRawIdentifierWhitespace))
667667
return false;
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// {"signature":"swift::Lexer::formEscapedIdentifierToken(char const*)"}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: not %target-swift-frontend -typecheck %s
33
``

0 commit comments

Comments
 (0)