<@U0CHHN4F4> you have plan to in the feature creat...
# scripting
s
@ilya.chernikov you have plan to in the feature create a Parse object that you use on the compilation. In my project a need to parse two times, the first ALWAYS will Fail because he is used for get something from a annotation and put on a list to sort the scripts for compile correctly. You can see here: https://github.com/DevSrSouza/Bukkript/blob/recode/host/src/main/kotlin/br/com/devsrsouza/bukkript/host/Host.kt#L26 If the script API has a parse object or something, this could be faster
i
So far we do not want to give any interface to the parsing, because it will require exposing internal APIs that we’re not considering stable. What is planned is support for “sections” compilation as with gradle’s
buildscript
and
plugins
, so you’ll be able to get a callback if a “section” is encountered, and will be able to compile it before coming back to the main script compilation. But I guess it is not what you want.
On the other hand, from the brief look into your code, I’ve got a feeling that it is quite similar to the things already implemented for import - there imported scrips are in fact sorted according to the dependency graph and compiled an executed in the proper order. So maybe it should be done a bit more flexible in order to accommodate your case too. Could you, please, describe the requirements in a bit more details.
s
I will try to describe with my bad english 😂. My project compile a list of scripts in a folder, one script can depend of other script content, like a constant or something, but she is not the only one that can depend on the same script. With importScripts, the compiler will compile this same script two or more times and the cache system will not work too.