pcpp icon indicating copy to clipboard operation
pcpp copied to clipboard

# operator keeps comments in the result

Open mrolle45 opened this issue 1 year ago • 1 comments

pcpp handles space and newline characters in the macro argument correctly by replacing all of them with a single space. However, it does not consider comments as whitespace. This code:

def mkstr(x) #x
mkstr ( a // comment
    b /* comment
      */ c)

results in

"a // comment b /* comment
      */ c"

This is fixed by simply including comment types in the value of Preprocessor.t_WS.

mrolle45 avatar Jan 18 '24 08:01 mrolle45

Thanks for the BR

ned14 avatar Jan 18 '24 11:01 ned14