owenca wrote:

> We can easily skip C/C++ preprocessor directives

For example:
```diff
--- a/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp
+++ b/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp
@@ -101,8 +101,12 @@ IntegerLiteralSeparatorFixer::process(const Environment 
&Env,
   Token Tok;
   tooling::Replacements Result;
 
-  for (bool Skip = false; !Lex.LexFromRawLexer(Tok);) {
+  for (bool Skip = false, IsPPLine = false; !Lex.LexFromRawLexer(Tok);) {
     auto Length = Tok.getLength();
+    if (Tok.isAtStartOfLine())
+      IsPPLine = Tok.is(tok::hash);
+    if (IsPPLine)
+      continue;
     if (Length < 2)
       continue;
     auto Location = Tok.getLocation();
```

https://github.com/llvm/llvm-project/pull/212328
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to