I have a use-case for a script like so:
// scriptA.as
#include scriptB.as
#include scriptC.as
My preprocessor encounters each #include line and calls AddScriptSection with the source of each of those files (e.g. AddScriptSection("scriptB.as"), followed by AddScriptSection("scriptC.as"), then replaces each line with a newline in scriptA.as (since the compiler wouldn't compile an actual #include line).
When I call AddScriptSection("scriptA.as") with what looks like the following for the source:
// scriptA.as
it gives me a warning about an empty script section.
It's not trivial to attempt to detect that this script section is indeed empty (before calling the final AddScriptSection()) as it would involve parsing for comments.. you can't just check whether the string is all empty/newlines.
Do you think it would be feasible to silently soft-fail on an AddScriptSection() with an empty source if the module already has other source (e.g. in other script sections added previously)? Perhaps as an engine option?
Thank you for any tips!