1.1 --- a/translator.py Fri Feb 10 16:01:18 2017 +0100
1.2 +++ b/translator.py Fri Feb 10 16:51:17 2017 +0100
1.3 @@ -142,7 +142,7 @@
1.4 elif static_name:
1.5 parent = ref.parent()
1.6 context = ref.has_kind("<function>") and encode_path(parent) or None
1.7 - return "((__attr) {.context=%s, .value=&%s})" % (context and "&%s" % context or "0", static_name)
1.8 + return "((__attr) {{.context=%s, .value=&%s}})" % (context and "&%s" % context or "0", static_name)
1.9
1.10 # Qualified names must be converted into parent-relative accesses.
1.11
1.12 @@ -875,7 +875,7 @@
1.13
1.14 if not ref.static():
1.15 self.process_assignment_for_object(
1.16 - n.name, make_expression("((__attr) {.context=0, .value=&%s})" %
1.17 + n.name, make_expression("((__attr) {{.context=0, .value=&%s}})" %
1.18 encode_path(class_name)))
1.19
1.20 self.enter_namespace(n.name)
1.21 @@ -1054,7 +1054,7 @@
1.22 context = self.is_method(objpath)
1.23
1.24 self.process_assignment_for_object(original_name,
1.25 - make_expression("((__attr) {.context=%s, .value=&%s})" % (
1.26 + make_expression("((__attr) {{.context=%s, .value=&%s}})" % (
1.27 context and "&%s" % encode_path(context) or "0",
1.28 encode_path(objpath))))
1.29
1.30 @@ -1414,14 +1414,14 @@
1.31 # Without defaults, produce an attribute referring to the function.
1.32
1.33 if not defaults:
1.34 - return make_expression("((__attr) {.context=0, .value=&%s})" % encode_path(function_name))
1.35 + return make_expression("((__attr) {{.context=0, .value=&%s}})" % encode_path(function_name))
1.36
1.37 # With defaults, copy the function structure and set the defaults on the
1.38 # copy.
1.39
1.40 else:
1.41 self.record_temp("__tmp_value")
1.42 - return make_expression("(__tmp_value = __COPY(&%s, sizeof(%s)), %s, (__attr) {.context=0, .value=__tmp_value})" % (
1.43 + return make_expression("(__tmp_value = __COPY(&%s, sizeof(%s)), %s, (__attr) {{.context=0, .value=__tmp_value}})" % (
1.44 encode_path(function_name),
1.45 encode_symbol("obj", function_name),
1.46 ", ".join(defaults)))