You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you have #include, #unittest (#push and #pop which aren't handled) handled by the parser which do their specific thing.
Now, I'm looking for a way to be able to expand that list into having my own - for instance #depends "library name" which in my mind could be handled by a new delegate for custom macros passing both the macro name 'depends' as well as the value (in literal string), and I'm wondering if this could be something considered as it could be used for anything like tagging scripts with a version #version "1.0.0" for example
EDIT:
I think it would be best if the delegate were to return a 'const char*' just like the others. If the returned value is NULL from the delegate handler, then it can treat it as an unhandled macro and throw an error accordingly, otherwise replace the macro in-source with the return value;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi @marcobambini
I want to table the idea of having custom macros
Currently you have #include, #unittest (#push and #pop which aren't handled) handled by the parser which do their specific thing.
Now, I'm looking for a way to be able to expand that list into having my own - for instance
#depends "library name"
which in my mind could be handled by a new delegate for custom macros passing both the macro name 'depends' as well as the value (in literal string), and I'm wondering if this could be something considered as it could be used for anything like tagging scripts with a version #version "1.0.0" for exampleEDIT:
I think it would be best if the delegate were to return a 'const char*' just like the others. If the returned value is NULL from the delegate handler, then it can treat it as an unhandled macro and throw an error accordingly, otherwise replace the macro in-source with the return value;
Regards,
Mike
Beta Was this translation helpful? Give feedback.
All reactions