jlevy/repren

--from does not accept pattern starting with #

c-bb opened this issue · 1 comments

c-bb commented
$ repren --from '#include <a.h>' --to '#include <b.h>' .
error: found no parse patterns

Same with --literal:

$ repren --literal --from '#include <a.h>' --to '#include <b.h>' .
error: found no parse patterns

This is because it interprets the # as a comment character (in function parse_patterns()).

It would be nice if this comment logic did not apply when patterns are supplied directly via --from --to, and/or when --literal is given.

jlevy commented

Yeah, agreed. Feel free to submit a PR (with a test showing it working).