clang-format not to eat up spaces before // clang-format off

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

clang-format not to eat up spaces before // clang-format off

Bakhvalov, Denis via cfe-dev
Hi,

I'd like to indent some flex files. In the following example, the
first "// clang-format off" must not start from the beginning of the
line. But clang-format will eat up the spaces from "// clang-format
off". Is there a way to keep the spaces before ""// clang-format off"?

$ clang-format < indent.l
// clang-format off
%option main noinput nounput
%%
. {
  // clang-format on
  while (0) {
    int a;
    a += 1;
  }
  // clang-format off
}
$ cat indent.l
   // clang-format off
%option main noinput nounput
%%
. {
  // clang-format on
while(0){int a;a +=                       1;}
  // clang-format off
}

--
Regards,
Peng
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev