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
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: