For the following multi-line string:
jsContext.evaluateScript(
"""
var console = {
log: function(data) { __swift_log(data); }
};
""")
A compilation error is reported:
error: repl.swift:37:9: error: insufficient indentation of next 2 lines in multi-line string literal
log: function(data) { __swift_log(data); }
^
repl.swift:39:9: note: should match space here
""")
^
repl.swift:37:9: note: change indentation of these lines to match closing delimiter
log: function(data) { __swift_log(data); }
I tried all sorts of things the only one that works is having the whole thing flush !!
"""
var console = {
log: function(data) { __swift_log(data); }
};
""")
That is an undesirable way to embed a heredoc / multi-line string. Is there an alternative?