changeset 708:3a4c7d444467

Added method interpret() to class SemanticPass2.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 29 Jan 2008 15:57:03 +0100
parents efa5fcb9aa14
children 7e7c85235673
files trunk/src/dil/semantic/Pass2.d
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/semantic/Pass2.d	Tue Jan 29 01:07:39 2008 +0100
+++ b/trunk/src/dil/semantic/Pass2.d	Tue Jan 29 15:57:03 2008 +0100
@@ -56,6 +56,11 @@
     scop = scop.exit();
   }
 
+  Expression interpret(Expression e)
+  {
+    return Interpreter.interpret(e, modul.infoMan, scop);
+  }
+
   void error(Token* token, char[] formatMsg, ...)
   {
     auto location = token.getErrorLocation();
@@ -93,7 +98,7 @@
       if (member.value)
       {
         member.value = visitE(member.value);
-        finalValue = Interpreter.interpret(member.value, modul.infoMan, scop);
+        finalValue = interpret(member.value);
         if (finalValue is Interpreter.NAR)
           continue;
       }
@@ -112,7 +117,7 @@
     if (md.isMixinExpression)
     {
       md.argument = visitE(md.argument);
-      auto expr = Interpreter.interpret(md.argument, modul.infoMan, scop);
+      auto expr = interpret(md.argument);
       if (expr is Interpreter.NAR)
         return md;
       auto stringExpr = expr.Is!(StringExpression);
@@ -296,7 +301,7 @@
     if (me.type)
       return me.expr;
     me.expr = visitE(me.expr);
-    auto expr = Interpreter.interpret(me.expr, modul.infoMan, scop);
+    auto expr = interpret(me.expr);
     if (expr is Interpreter.NAR)
       return me;
     auto stringExpr = expr.Is!(StringExpression);
@@ -320,7 +325,7 @@
     if (ie.type)
       return ie.expr;
     ie.expr = visitE(ie.expr);
-    auto expr = Interpreter.interpret(ie.expr, modul.infoMan, scop);
+    auto expr = interpret(ie.expr);
     if (expr is Interpreter.NAR)
       return ie;
     auto stringExpr = expr.Is!(StringExpression);