OpenMS / autowrap

Generates Python Extension modules from Cythons PXD files
Other
75 stars 22 forks source link

Multiline comment parsing update breaks things #186

Open poshul opened 7 months ago

poshul commented 7 months ago

https://github.com/OpenMS/autowrap/blame/35eb3ab6154b7c87337f886dec318a980cd4b431/autowrap/PXDParser.py#L119 This breaks a lot of places where we have comments ending in colons that have no syntactic meaning. It also lacks any error reporting as to which PXD failed the parsing, making debugging the whole of pyOpenMS very difficult.

jpfeuffer commented 7 months ago

I would't say it broke it. It just errors out now. The check for a potential wrap statement was defined as "ending with a colon" since 12 years. And there should never be a colon in a class annotation that is not indented under a wrap-doc: statement. In that case annotations would simply be wrong.

I agree however, that checking e.g. for wrap-*: would be safer though more restrictive.

Yes, line numbers would be nice but I do not know off the top of my head if that is easily possibe. You would need to pass the information about the PXD node that is currently parsed to the _parse_multiline_comment function or catch the Exception in the function that still has access to that information.

jpfeuffer commented 7 months ago

I would start by opening a PR here with a test that fails.