Closed FriedrichGretz closed 3 years ago
Commit 51d42f35a79bd36b860208b45c7e8ff191bdec25 fixes this issue.
You have to use triple quotes (multi-line strings) to enter double quotes "
in the C binding.
@[CFunction (binding = """print("bla?\n");""",
header = "main.h")]
extern function foobar()
The signature now contains the correct binding. The generated C macro in the .h-file is now correct.
Describe the bug
generates code as expected when used in a Blech program. However when used in a Blech module, an invalid signature is generated because the quotes are not escaped:
Also notice that the
\n
is now escaped only once and would result in an actual line break in the generated code.Expected behaviour The expected behaviour is to copy the binding exactly as is to the signature.
Additional context Using multi-line strings in the binding
"""
has the same result.