From 51e6215b0263fe70a7f335e449f7841b8148adc7 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Mon, 4 Apr 2022 13:31:54 -0700 Subject: [PATCH] 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. --- src/api/python/genenums.py.in | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.30.2