See this post: http://www.byond.com/developer/forum/?id=768946
In short, attempts to use #define'd macros in variable declarations is failing, producing an error that makes it look like this:
#define test list
var/test/a
is expanding to this:
var/test /a
Code Snippet (if applicable) to Reproduce Problem:
#define test list
var/test/a // Syntax error
var/list /a // Same syntax error
var/list/a // Works, of course
var/test // Works
b
var/list // Note space on end. Works.
c
This may be expected behaviour - I'm seeking a clarification.
Expected Results:
#define'd macros should not have a space appended on the end - var/test/a should compile.
Actual Results:
Syntax error.
Does the problem occur:
Every time? Or how often?
Yes.
In other user accounts?
Yes, a forum thread by Ripiz brought the problem up.
On other computers?
Yes, a forum thread by Ripiz brought the problem up.
When does the problem NOT occur?
#define test list
var/test
a
works, which leads me to suspect the trailing space.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Haven't checked, I'm afraid. But my guess is that you haven't touched the preprocessor for a while...
Workarounds:
Use of the token-pasting operator, as follows:
#define test(x) list/##x
var/test(a)
Looks a bit ugly, though, rather than the syntactical mimicry that was originally aimed for.
Appending the newline (var/test\na) isn't always possible - function argument lists don't accept a newline in the appropriate spot.