Skip to content

# operator keeps comments in the result #94

@mrolle45

Description

@mrolle45

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions