|
35 | 35 | using namespace swift;
|
36 | 36 | using namespace swift::syntax;
|
37 | 37 |
|
38 |
| -// clang::isIdentifierHead and clang::isIdentifierBody are deliberately not in |
39 |
| -// this list as a reminder that they are using C rules for identifiers. |
40 |
| -// (Admittedly these are the same as Swift's right now.) |
| 38 | +// clang::isAsciiIdentifierStart and clang::isAsciiIdentifierContinue are |
| 39 | +// deliberately not in this list as a reminder that they are using C rules for |
| 40 | +// identifiers. (Admittedly these are the same as Swift's right now.) |
41 | 41 | using clang::isAlphanumeric;
|
42 | 42 | using clang::isDigit;
|
43 | 43 | using clang::isHexDigit;
|
@@ -514,7 +514,7 @@ void Lexer::skipSlashStarComment() {
|
514 | 514 |
|
515 | 515 | static bool isValidIdentifierContinuationCodePoint(uint32_t c) {
|
516 | 516 | if (c < 0x80)
|
517 |
| - return clang::isIdentifierBody(c, /*dollar*/true); |
| 517 | + return clang::isAsciiIdentifierContinue(c, /*dollar*/true); |
518 | 518 |
|
519 | 519 | // N1518: Recommendations for extended identifier characters for C and C++
|
520 | 520 | // Proposed Annex X.1: Ranges of characters allowed
|
@@ -672,10 +672,10 @@ void Lexer::lexHash() {
|
672 | 672 |
|
673 | 673 | // Scan for [a-zA-Z]+ to see what we match.
|
674 | 674 | const char *tmpPtr = CurPtr;
|
675 |
| - if (clang::isIdentifierHead(*tmpPtr)) { |
| 675 | + if (clang::isAsciiIdentifierStart(*tmpPtr)) { |
676 | 676 | do {
|
677 | 677 | ++tmpPtr;
|
678 |
| - } while (clang::isIdentifierBody(*tmpPtr)); |
| 678 | + } while (clang::isAsciiIdentifierContinue(*tmpPtr)); |
679 | 679 | }
|
680 | 680 |
|
681 | 681 | // Map the character sequence onto
|
@@ -2442,10 +2442,10 @@ void Lexer::lexImpl() {
|
2442 | 2442 | return lexOperatorIdentifier();
|
2443 | 2443 | case '%':
|
2444 | 2444 | // Lex %[0-9a-zA-Z_]+ as a local SIL value
|
2445 |
| - if (InSILBody && clang::isIdentifierBody(CurPtr[0])) { |
| 2445 | + if (InSILBody && clang::isAsciiIdentifierContinue(CurPtr[0])) { |
2446 | 2446 | do {
|
2447 | 2447 | ++CurPtr;
|
2448 |
| - } while (clang::isIdentifierBody(CurPtr[0])); |
| 2448 | + } while (clang::isAsciiIdentifierContinue(CurPtr[0])); |
2449 | 2449 |
|
2450 | 2450 | return formToken(tok::sil_local_name, TokStart);
|
2451 | 2451 | }
|
|
0 commit comments