diff sema/ImplicitCast.d @ 88:eb5b2c719a39 new_gen

Major change to locations, tokens and expressions. A location (now SourceLocation or SLoc) is only 32 bit in size - disadvantage is that it can't find its own text. You have to go through the new SourceManager to do that. This has caused changes to a lot of stuff and removal of DataSource and the old Location Additionally Exp has gotten some location stuff, so we can give proper error messages. Not in Decl and Stmt yet, but thats coming too.
author Anders Halager <halager@gmail.com>
date Sun, 04 May 2008 18:13:46 +0200
parents 9a35a973175a
children
line wrap: on
line diff
--- a/sema/ImplicitCast.d	Sun May 04 12:58:02 2008 +0200
+++ b/sema/ImplicitCast.d	Sun May 04 18:13:46 2008 +0200
@@ -5,7 +5,8 @@
 
 import tango.io.Stdout;
 
-import misc.Error;
+import misc.Error,
+       basic.SourceLocation;
 
 class ImplicitCast : Visitor!(void)
 {
@@ -24,6 +25,7 @@
                 throw error(__LINE__, "Cannot make implicit cast");
 
             auto castExp = new CastExp(
+                    SLoc.Invalid,
                     new Identifier(exp.left.type.name),
                     exp.right);
             castExp.env = exp.env;
@@ -36,6 +38,7 @@
                 throw error(__LINE__, "Cannot make implicit cast");
 
             auto castExp = new CastExp(
+                    SLoc.Invalid,
                     new Identifier(exp.right.type.name),
                     exp.left);
             castExp.env = exp.env;
@@ -60,6 +63,7 @@
                     throw error(__LINE__, "Cannot make implicit cast");
 
                 auto castExp = new CastExp(
+                        SLoc.Invalid,
                         new Identifier(argType.name),
                         arg);
                 castExp.env = exp.exp.env;
@@ -85,6 +89,7 @@
                 throw error(__LINE__, "Cannot make implicit cast between");
 
             auto castExp = new CastExp(
+                    SLoc.Invalid,
                     new Identifier(expType.name),
                     exp.exp);
             castExp.env = exp.exp.env;
@@ -106,6 +111,7 @@
                     throw error(__LINE__, "Cannot make implicit cast");
 
                 auto castExp = new CastExp(
+                        SLoc.Invalid,
                         new Identifier(returnType.name),
                         stmt.exp);
                 castExp.env = stmt.exp.env;
@@ -128,6 +134,7 @@
                     throw error(__LINE__, "Cannot make implicit cast");
 
                 auto castExp = new CastExp(
+                        SLoc.Invalid,
                         new Identifier(varType.name),
                         decl.init);
                 castExp.env = decl.init.env;