Mercurial > projects > dang
comparison basic/SourceLocation.d @ 148:6ec686d9c87d
Fixed some for parsing, and removed a little ugly bug.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Mon, 21 Jul 2008 20:28:11 +0200 |
parents | 89db676fbacb |
children |
comparison
equal
deleted
inserted
replaced
147:060b6eb16db9 | 148:6ec686d9c87d |
---|---|
1 module basic.SourceLocation; | 1 module basic.SourceLocation; |
2 | |
3 import Integer = tango.text.convert.Integer; | |
2 | 4 |
3 /// Shorter alias for SourceLocation | 5 /// Shorter alias for SourceLocation |
4 public alias SourceLocation SLoc; | 6 public alias SourceLocation SLoc; |
5 | 7 |
6 /// SourceLocation points to a place in some buffer | 8 /// SourceLocation points to a place in some buffer |
75 SourceLocation res; | 77 SourceLocation res; |
76 res.val = fileID << Bits.FileOffset; | 78 res.val = fileID << Bits.FileOffset; |
77 return res; | 79 return res; |
78 } | 80 } |
79 | 81 |
82 char[] toString() | |
83 { | |
84 return Integer.toString(val); | |
85 } | |
80 /** | 86 /** |
81 Used for invalid/unknown locations. (also the default value, but this is | 87 Used for invalid/unknown locations. (also the default value, but this is |
82 more explicit) | 88 more explicit) |
83 **/ | 89 **/ |
84 static const SourceLocation Invalid = {val: uint.max}; | 90 static const SourceLocation Invalid = {val: uint.max}; |