I'm trying to use a #define function directive to remove string quotations. Kind of like the opposite of stringizing.
For example, if there was an operator to do this which I am representing as ~ (I know there isn't but if there was). I want it to be like:
1 2
#define macr(name) ~name
text macr("name") othertext
This would then turn it into:
text name othertext
Note I am not doing this to try and get a variable value, I am running a parser upon the outputted code afterwards. I know I could use the parser itself to remove the string quotations but I want to know if there is any possible way of doing this using the preprocessor?
^ That's a great idea though. But I don't know how you define braces? If you try #define macro(" it errors that it wants a closing brace as macros use the braces for the function notation.
Doesn't seem like a good idea to me, but I don't have much of an idea. I would say do it in the parser to keep the original file in it's original state.
You do understand that you should force those who send you an input file to use your macro, and if you can do that you can just tell them to not use quotes.