twisted / pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
https://pydoctor.readthedocs.io
Other
190 stars 51 forks source link

Edge case regex pattern colorization #668

Open tristanlatr opened 1 year ago

tristanlatr commented 1 year ago

Some regex patterns are not colorized correctly. We could add a check to ensure that the colorized pattern round trips, and if it doesn’t then we fallback to the generic string colorization.

https://github.com/twisted/pydoctor/pull/667#discussion_r1034127601

Since we know our regex colorizer is not perfect, we shouldn’t emit warnings about failures in the regex colorizing.

tristanlatr commented 1 month ago

In terms of alternatives I found the following:

It might be less work to properly adjust sre_parse36.py to only to the roundtripable parsing job without any optimizations