Using curly braces in macro arguments causes a compile error related to strings.
Numbered Steps to Reproduce Problem:
Compile code below.
Code Snippet (if applicable) to Reproduce Problem:
#define IDENTITY(x) x
/world/New()
IDENTITY( if(1) { world.log << "foo" } ) // error: unterminated text doc (expecting "})
// This is OK
IDENTITY( if(1) world.log << "foo" )
#define BEGIN {
#define END }
// This is OK
IDENTITY( if(1) BEGIN world.log << "foo" END )
Expected Results:
Compile success
Actual Results:
Compile failure with `error: unterminated text doc (expecting "})`
Does the problem occur:
Every time? Or how often? Every time
In other games? N/A
In other user accounts? Yes
On other computers? Yes
When does the problem NOT occur?
When you don't use curly braces in macro arguments
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unknown
Workarounds: Define BEGIN and END as { and } and use those instead.