Mercurial > projects > dang
diff sema/DType.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 | 9e90694f5da0 |
children | 438e6ed4cda1 |
line wrap: on
line diff
--- a/sema/DType.d Sun May 04 12:58:02 2008 +0200 +++ b/sema/DType.d Sun May 04 18:13:46 2008 +0200 @@ -8,14 +8,13 @@ class DType { private char[] id; - private Location loc; + private SourceLocation loc; public DType actual; this(Identifier id, DType actual = null) { - Token temp = id.token; - this.id = temp.get; - this.loc = temp.location; + this.id = id.name; + this.loc = id.startLoc(); this.actual = actual is null? this : actual; } @@ -77,7 +76,7 @@ } char[] name() { return id; } - Location getLoc() { return loc; } + SourceLocation getLoc() { return loc; } int byteSize() { return 0; } /**