Skip to content

Commit

Permalink
Merge pull request sebastianbenz#28 from riederm/richstring_mavem_exa…
Browse files Browse the repository at this point in the history
…mple

Richstring mavem example - fix sebastianbenz#27
  • Loading branch information
riederm authored Jun 13, 2017
2 parents 660a381 + 33b97b1 commit bd72116
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ describe "Calculator"{
examples.forEach[a + b => sum]
}

}
fact "load a richstring" {
examples.forEach[
val x = '''pre «b» post'''
x => "pre " + b + " post"
]

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import java.util.List;

import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.xbase.annotations.XbaseWithAnnotationsStandaloneSetup;
import org.jnario.feature.FeatureStandaloneSetupGenerated;
import org.jnario.feature.feature.FeaturePackage;
import org.jnario.spec.SpecStandaloneSetupGenerated;
import org.jnario.spec.spec.SpecPackage;
import org.jnario.suite.SuiteStandaloneSetupGenerated;
import org.jnario.suite.suite.SuitePackage;
import org.jnario.xbase.richstring.XbaseWithRichstringStandaloneSetup;

import com.google.inject.Guice;
import com.google.inject.Injector;
Expand All @@ -23,7 +23,7 @@ public List<Injector> createInjectorAndDoEMFRegistration() {
return injectors;

List<Injector> injectors = new ArrayList<Injector>();
XbaseWithAnnotationsStandaloneSetup.doSetup();
XbaseWithRichstringStandaloneSetup.doSetup();

injectors.add(registerFeature());
injectors.add(registerSpec());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationsPackage;
import org.jnario.JnarioPackage;
import org.jnario.feature.feature.FeaturePackage;
import org.jnario.xbase.richstring.xbasewithrichstring.XbaseWithRichstringPackage;

import com.google.inject.Injector;

Expand All @@ -27,6 +28,7 @@ public static void doSetup() {
@Override
public Injector createInjectorAndDoEMFRegistration() {
EPackage.Registry.INSTANCE.put(XAnnotationsPackage.eINSTANCE.getNsURI(),XAnnotationsPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(XbaseWithRichstringPackage.eNS_URI, XbaseWithRichstringPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(JnarioPackage.eNS_URI, JnarioPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(FeaturePackage.eNS_URI, FeaturePackage.eINSTANCE);
return super.createInjectorAndDoEMFRegistration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.eclipse.emf.ecore.EPackage;
import org.jnario.JnarioPackage;
import org.jnario.spec.spec.SpecPackage;
import org.jnario.xbase.richstring.xbasewithrichstring.XbaseWithRichstringPackage;

import com.google.inject.Injector;

Expand All @@ -26,6 +27,7 @@ public static void doSetup() {

@Override
public Injector createInjectorAndDoEMFRegistration() {
EPackage.Registry.INSTANCE.put(XbaseWithRichstringPackage.eNS_URI, XbaseWithRichstringPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(JnarioPackage.eNS_URI, JnarioPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(SpecPackage.eNS_URI, SpecPackage.eINSTANCE);
return super.createInjectorAndDoEMFRegistration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
*/
package org.jnario.xbase.richstring;

import org.eclipse.emf.ecore.EPackage;
import org.jnario.xbase.richstring.xbasewithrichstring.XbaseWithRichstringPackage;

import com.google.inject.Injector;

/**
* Initialization support for running Xtext languages
* without equinox extension registry
Expand All @@ -12,5 +17,12 @@ public class XbaseWithRichstringStandaloneSetup extends XbaseWithRichstringStand
public static void doSetup() {
new XbaseWithRichstringStandaloneSetup().createInjectorAndDoEMFRegistration();
}


@Override
public Injector createInjectorAndDoEMFRegistration() {
EPackage.Registry.INSTANCE.put(XbaseWithRichstringPackage.eNS_URI, XbaseWithRichstringPackage.eINSTANCE);
return super.createInjectorAndDoEMFRegistration();
}
}

0 comments on commit bd72116

Please sign in to comment.