This plugin_strategy_invoke_0_2 Java 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.

Submitted by Oskar van Rest on 25 July 2013 at 02:30

On 25 July 2013 at 02:48 Gabriël Konat commented:

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.


On 25 July 2013 at 02:50 Gabriël Konat commented:

Actually, now that I look at the IMPLibrary, there is a primitive that does this: ForeignLangCallPrimitive :P


On 25 July 2013 at 20:01 Oskar van Rest commented:

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

On 25 July 2013 at 20:46 Oskar van Rest commented:

Actually, it works fine. I just forgot to pass it some parameters.

I think a ForeignLangParsePrimitive and a LanguageByExtensionPrimitive would also be very useful.
And I guess all three should end up in lib/runtime/editor/languages.str?


On 25 July 2013 at 23:29 Gabriël Konat commented:

Yes, but you have to either manually add them to the generator, or have me run a program to automatically do this.


On 20 August 2013 at 01:55 Oskar van Rest commented:

Fixed in nightly.
The primitive is exposed in lib/.../editor/interop.str.


On 20 August 2013 at 01:55 Oskar van Rest closed this issue.

On 28 July 2014 at 22:44 Gabriël Konat tagged 1.2

Log in to post comments