diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /include/clang/Basic/CharInfo.h | |
parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) |
Notes
Diffstat (limited to 'include/clang/Basic/CharInfo.h')
-rw-r--r-- | include/clang/Basic/CharInfo.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/clang/Basic/CharInfo.h b/include/clang/Basic/CharInfo.h index cc27bbb48e0d1..e6c5e90d346c6 100644 --- a/include/clang/Basic/CharInfo.h +++ b/include/clang/Basic/CharInfo.h @@ -1,4 +1,4 @@ -//===--- clang/Basic/CharInfo.h - Classifying ASCII Characters ------------===// +//===--- clang/Basic/CharInfo.h - Classifying ASCII Characters --*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -180,14 +180,15 @@ LLVM_READONLY inline char toUppercase(char c) { /// Return true if this is a valid ASCII identifier. /// -/// Note that this is a very simple check; it does not accept '$' or UCNs as -/// valid identifier characters. -LLVM_READONLY inline bool isValidIdentifier(StringRef S) { - if (S.empty() || !isIdentifierHead(S[0])) +/// Note that this is a very simple check; it does not accept UCNs as valid +/// identifier characters. +LLVM_READONLY inline bool isValidIdentifier(StringRef S, + bool AllowDollar = false) { + if (S.empty() || !isIdentifierHead(S[0], AllowDollar)) return false; for (StringRef::iterator I = S.begin(), E = S.end(); I != E; ++I) - if (!isIdentifierBody(*I)) + if (!isIdentifierBody(*I, AllowDollar)) return false; return true; |