I noticed Blizzard assigned parenthesis a higher precedence than the double quote character " for their Galaxy Editor trigger parser (the parenthesis are evaluated first, even if they're in a string). How can I include a parenthesis in a preprocessor directive string?
I tried the standard escape characters \ and /, and the "force string and don't process" operator (single quote) instead of double quotes. I even tried backquotes, none of it worked, the parenthesis were always processed first.
But that does not work with the real problem, fine there is a escape command for stuff like \" in strings but that won't fix the mentioned problem ... that " ( " and " ) " are compiled before strings get compiled, and so things like i posted don't work
Yes, exactly that. I looked through all their preprocessor usage in the libraries, but wasn't able to find anything that might be useful. They might have simply never implemented parsing single quotes as force string or escape characters because they didn't anticipate people using function calls in macros...
I noticed Blizzard assigned parenthesis a higher precedence than the double quote character " for their Galaxy Editor trigger parser (the parenthesis are evaluated first, even if they're in a string). How can I include a parenthesis in a preprocessor directive string?
I tried the standard escape characters \ and /, and the "force string and don't process" operator (single quote) instead of double quotes. I even tried backquotes, none of it worked, the parenthesis were always processed first.
You are refering to smth like (note this is Custom Script Code)
#AUTOVAR(x,fixed) = PointGetX( (#PARAM(x1, ") " #PARAM(op) " PointGetX( " ) ) )
stopping at ") " instead of running the whole line?
have tried this too, i think it's a compiler problem as no escape cmd is currently possible (atleast not the common ones)
There is. It's \" for a normal "
@s3rius: Go
But that does not work with the real problem, fine there is a escape command for stuff like \" in strings but that won't fix the mentioned problem ... that " ( " and " ) " are compiled before strings get compiled, and so things like i posted don't work
@xhatix: Go
Yes, exactly that. I looked through all their preprocessor usage in the libraries, but wasn't able to find anything that might be useful. They might have simply never implemented parsing single quotes as force string or escape characters because they didn't anticipate people using function calls in macros...
I'm attempting to do something similar:
More complex than that, but it's the basic idea. If backslash is used:
After the preprocessor runs, the result of passing 0, 1, 2 is:
There could very well be some non-standard escape character or method we just don't know about due to it not being used in the game's libraries . . .
My fault. Misunderstood the problem.