Mercurial > projects > dil
annotate trunk/src/dil/Identifier.d @ 391:33b566df6af4
Migrated project to Tango.
Decremented the numbers of the format placeholders in the localized messages
by one.
Replaced all instances of writef/ln with Stdout.
Added module common.d with string aliases and a global Layout!(char) instance.
Replaced %s format specifiers with index placeholders in html/xml_tags.
Changed member Information.arguments to string message.
Copied std.metastring, std.uni and std.utf from Phobos.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 15 Sep 2007 17:12:26 +0200 |
parents | a48a987f7515 |
children | 52447db67938 |
rev | line source |
---|---|
274 | 1 /++ |
2 Author: Aziz Köksal | |
3 License: GPL3 | |
4 +/ | |
326 | 5 module dil.Identifier; |
327 | 6 import dil.Token; |
391
33b566df6af4
Migrated project to Tango.
Aziz K?ksal <aziz.koeksal@gmail.com>
parents:
327
diff
changeset
|
7 import common; |
274 | 8 |
9 struct Identifier | |
10 { | |
11 TOK type; | |
12 string str; | |
13 | |
14 static Identifier opCall(TOK type, string str) | |
15 { | |
16 Identifier i; | |
17 i.type = type; | |
18 i.str = str; | |
19 return i; | |
20 } | |
21 | |
22 uint toHash() | |
23 { | |
24 uint hash; | |
25 foreach(c; str) { | |
26 hash *= 9; | |
27 hash += c; | |
28 } | |
29 return hash; | |
30 } | |
31 } |