Skip to content

Commit 2af9a1d

Browse files
author
Davide Italiano
committed
[Lexer] Allow '$x' to be parsed as identifier in debugger mode.
This is needed to support `print $0` in lldb where `$0` is the shortcut for a closure argument. The associated lldb change will be merged together with this one and will contain a test. <rdar://problem/201719448>
1 parent e7dd7b2 commit 2af9a1d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Parse/Lexer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,8 @@ void Lexer::lexDollarIdent() {
936936
// independent of language mode.
937937
return formToken(tok::identifier, tokStart);
938938
} else {
939+
if (LangOpts.EnableDollarIdentifiers && !LangOpts.Playground)
940+
return formToken(tok::identifier, tokStart);
939941
return formToken(tok::dollarident, tokStart);
940942
}
941943
}

0 commit comments

Comments
 (0)