From: Gereon Kremer Date: Mon, 4 Apr 2022 20:31:54 +0000 (-0700) Subject: Remove duplicate lines (#8552) X-Git-Tag: cvc5-1.0.0~24 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51e6215b0263fe70a7f335e449f7841b8148adc7;p=cvc5.git Remove duplicate lines (#8552) We remove the arguments from links to solver methods in the Kinds documentation to turn C++ references into python references. This oftentimes collapses previously different overload of methods (usually mkTerm()). This PR generically removes duplicate lines from these comments using some re magic. --- diff --git a/src/api/python/genenums.py.in b/src/api/python/genenums.py.in index ccab48a82..dc3c4774c 100644 --- a/src/api/python/genenums.py.in +++ b/src/api/python/genenums.py.in @@ -79,8 +79,11 @@ comment_repls = { def reformat_comment(comment): + # apply replacements from above for pat, repl in comment_repls.items(): comment = re.sub(pat, repl, comment) + # remove duplicate lines (e.g. overloads collapse from previous substitutions) + comment = re.sub('^(?P.*)$\n^(?P=line)$', '\\g', comment, flags=re.MULTILINE) return comment