plugin-strategy-invoke should be a primitive
ThisSubmitted by Oskar van Rest on 25 July 2013 at 02:30
plugin_strategy_invoke_0_2Java Strategy that Lennart once wrote is now being copied and pasted into multiple projects (I’m also planning to use it in two projects). It would be nice if it would be a primitive instead.
I agree. Since this is a Spoofax/IMP thing this should go into org.strategoxt.imp.runtime, specifically the IMPLibrary: https://github.com/metaborg/spoofax/blob/master/org.strategoxt.imp.runtime/src/org/strategoxt/imp/runtime/stratego/IMPLibrary.java.
Actually, now that I look at the IMPLibrary, there is a primitive that does this: ForeignLangCallPrimitive :P
It seems like that one is broken though, but I’m going to try to fix that.
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at org.strategoxt.imp.runtime.stratego.ForeignLangCallPrimitive.call(ForeignLangCallPrimitive.java:48) at org.strategoxt.lang.Context.invokePrimitive(Context.java:227) ... 19 more
Actually, it works fine. I just forgot to pass it some parameters.
I think a
LanguageByExtensionPrimitivewould also be very useful.
And I guess all three should end up in
Yes, but you have to either manually add them to the generator, or have me run a program to automatically do this.
Fixed in nightly.
The primitive is exposed in
Log in to post comments