Closed wc-duck closed 4 years ago
I think I'll actually skip "usercode" as it stands now as it do not provide enough benefit to be able to include "any code". It feels too big as c++-code can do and be shaped in many ways that would need parsing and special casing. I don't think that complexity is worth the gain. However I'm thinking about adding a "user_includes"-section in the .tld instead as that would bring almost all the benefits without the downsides on the implementation side.
That section would be just an array of strings such as:
"user_includes" : [
"apa/kossa.h", // would generate #include "apa/kossa.h"
"<whipp/whopp>" // if the include start with '<' it would generate #include <whipp/whopp>
]
Oh just one user include would be enough, but if you have a list then that covers it more than enough!
Fixed by adding support for "c_includes" and removing support for "usercode"
"usercode" was previously used to inject code in the generated headers as needed but was not re-implemented when the json-parser in the compiler was reworked.
It was used for such things as adding includes to the generated headers for use with external types.