[PATCH] D30748: [Lexer] Finding beginning of token with escaped new line

Paweł Żukowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 08:07:18 PDT 2017


idlecode marked 3 inline comments as done.
idlecode added inline comments.


================
Comment at: lib/Lex/Lexer.cpp:460
+/// \brief Check if new line pointed by Str is escaped.
+bool isNewLineEscaped(const char *BufferStart, const char *Str) {
+  assert(isVerticalWhitespace(Str[0]));
----------------
alexfh wrote:
> The way the function is exposed to the test may lead to confusion. I'd either properly declare it in the header (and place it in a namespace, if it is not yet) or at least leave a comment here that the function is not static, since it needs to be exposed to the test.
Ok, I have made `isNewLineEscaped` a static method of `Lexer` - in Lexer.h there were no global function declaration and I didn't like the idea of introducing one.
I would make it protected/private member but it have to be visible to unit tests (and introducing friend classes just for this method doesn't seem worth it).


https://reviews.llvm.org/D30748





More information about the cfe-commits mailing list