in reply to Re: joining lines efficiency?
in thread joining lines efficiency?

While your proposal needs less memory, it can go wrong as well. Should the comment start or end on a line with code outside of the comments, the whole line and the code will be removed. The regex also needs to be more sophisticated to ignore "/*" ie should the characters be quoted.

Replies are listed 'Best First'.
Re^3: joining lines efficiency?
by AnomalousMonk (Archbishop) on Jun 10, 2013 at 16:16 UTC
    The regex also needs to ... ignore "/*" ie should the characters be quoted.

    It should also handle stuff like this, which compiles and runs just fine:

    #include <stdio.h> #include <assert.h> void main (int argc, char ** argv) { int x = 4; int y = 2; int * p = &y; assert(x/*p == 12345 /* p points to y */); printf("everything looks just fine \n"); }