summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahaase2008-01-23 08:39:16 (EST)
committerahaase2008-01-23 08:39:16 (EST)
commit869af3e1ceb9c9930e983093a23df2f38a85a251 (patch)
tree5235fc3c1a151027d4362a70629bb1c336019417
parentcbe865cc9ec0088c44b47f7deeea6edaacadf03e (diff)
downloadorg.eclipse.xpand-869af3e1ceb9c9930e983093a23df2f38a85a251.zip
org.eclipse.xpand-869af3e1ceb9c9930e983093a23df2f38a85a251.tar.gz
org.eclipse.xpand-869af3e1ceb9c9930e983093a23df2f38a85a251.tar.bz2
actually registered the XtendLib with all Xpand and Xtend functions
-rw-r--r--plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXpandRegistry.java8
-rw-r--r--plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXtendRegistry.java4
2 files changed, 8 insertions, 4 deletions
diff --git a/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXpandRegistry.java b/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXpandRegistry.java
index 9fab5f7..65ef7f7 100644
--- a/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXpandRegistry.java
+++ b/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXpandRegistry.java
@@ -27,6 +27,7 @@ import org.eclipse.xtend.backend.common.NamedFunction;
import org.eclipse.xtend.backend.functions.FunctionDefContextImpl;
import org.eclipse.xtend.backend.types.CompositeTypesystem;
import org.eclipse.xtend.backend.util.Cache;
+import org.eclipse.xtend.backend.xtendlib.XtendLibContributor;
/**
@@ -73,8 +74,6 @@ final class OldXpandRegistry {
if (_functionsByResource.containsKey (xpandFile))
return;
- System.err.println ("registering xpand file " + xpandFile);
-
final String xpandResourceName = OldXtendHelper.xpandFileAsOldResourceName(xpandFile);
final Template file = (Template) _ctx.getResourceManager().loadResource (xpandResourceName, XpandUtil.TEMPLATE_EXTENSION);
if (file == null)
@@ -88,6 +87,9 @@ final class OldXpandRegistry {
final List<NamedFunction> defined = new ArrayList<NamedFunction>();
final FunctionDefContextImpl fdc = getFunctionDefContext (xpandFile);
+ // register the XtendLib. Do this first so the extension can override functions
+ fdc.register (new XtendLibContributor (_ts));
+
//TODO imported namespaces
final Set<XpandDefinitionName> referenced = new HashSet<XpandDefinitionName> ();
@@ -108,8 +110,6 @@ final class OldXpandRegistry {
fdc.register (f);
}
- System.err.println ("referenced template definitions: " + referenced);
-
// read all referenced template files...
final Set<String> xpandFileNames = new HashSet<String> ();
for (XpandDefinitionName n: referenced)
diff --git a/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXtendRegistry.java b/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXtendRegistry.java
index 93b21b4..fee268a 100644
--- a/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXtendRegistry.java
+++ b/plugins/org.eclipse.xtend.middleend.old/src/org/eclipse/xtend/middleend/old/OldXtendRegistry.java
@@ -27,6 +27,7 @@ import org.eclipse.xtend.backend.common.NamedFunction;
import org.eclipse.xtend.backend.functions.FunctionDefContextImpl;
import org.eclipse.xtend.backend.types.CompositeTypesystem;
import org.eclipse.xtend.backend.util.Cache;
+import org.eclipse.xtend.backend.xtendlib.XtendLibContributor;
import org.eclipse.xtend.expression.ExecutionContext;
@@ -100,6 +101,9 @@ final class OldXtendRegistry {
final List<NamedFunction> exported = new ArrayList<NamedFunction>();
final FunctionDefContextImpl fdc = getFunctionDefContext (xtendFile);
+
+ // register the XtendLib. Do this first so the extension can override functions
+ fdc.register (new XtendLibContributor (_ts));
for (Extension ext: file.getExtensions()) {
final NamedFunction f = extensionFactory.create (ext, fdc);