Consider this:
(set: $a to (datamap:
1, "test",
2, ")"
))
I want to use the closing parenthesis symbol as a piece of text, that's why it's between double quotes.
The problem is that Harlowe wrongly understands that parenthesis as pairing with "(datamap:" and closing the macro. The closing parenthesis always gets paired to the nearest opening parenthesis, even if quotes should prevent that.
Putting the parenthesis between inverted commas, "`)`", didn't help me either.
Just in advance of replies: no, I can't use another character, only ")", and yes, it has to be unpaired, no previous "(".
Is there any way I can do this? Is this a legitimate bug? Thanks!
Comments
Is this documented? The manual tells about tildes to escape markup, and the backslash only for line breaks.
The backslash character is used to escape special characters within a Javascript String value, although a close parenthesis is not normally considered a special character. The backslash is also used to escape special characters in a regular expression and the close parenthesis is a special character in them.
The fact that you needed to escape the close parenthesis leads me to believe that you have found a bug in the regular expression used for either the (datamap:) or (set:) macro.
I suggest you create a new issue on the Harlowe project website so that it can be fixed.
I just checked that this most simple example doesn't work:
Thanks everyone.