From: Philipp Gesang Date: Tue, 5 Dec 2017 12:47:45 +0000 (+0100) Subject: when emitting CNF lines, force capitalization of variable names X-Git-Tag: v1.4~18^2~7 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=5226025f3b9a1a3dd4e3a587d1101173d3b60672;p=pyi2ncommon when emitting CNF lines, force capitalization of variable names --- diff --git a/src/cnfvar.py b/src/cnfvar.py index 3dd7745..766e299 100644 --- a/src/cnfvar.py +++ b/src/cnfvar.py @@ -571,6 +571,9 @@ cnf_line_child_fmt = "%d %s(%d) %s,%d: \"%s\"" def format_cnf_vars(da, var): """ Return a list of formatted cnf_line byte strings. + + The variable names are uppercased unconditionally because while ``get_cnf`` + is case-indifferent for variable names, ``set_cnf`` isn’t. """ depth, acc = da @@ -578,17 +581,17 @@ def format_cnf_vars(da, var): if depth > 0: line = cnf_line_child_fmt \ % (var["number"], - cnf_line_nest_indent * depth, - var["parent"], - var["varname"], - var["instance"], - var["data"]) + cnf_line_nest_indent * depth, + var["parent"], + var["varname"].upper (), + var["instance"], + var["data"]) else: line = cnf_line_base_fmt \ % (var["number"], - var["varname"], - var["instance"], - var["data"]) + var["varname"].upper (), + var["instance"], + var["data"]) comment = var.get("comment", None) if comment and len (comment) != 0: