Mercurial > projects > dang
diff basic/SourceManager.d @ 92:771ac63898e2 new_gen
A few better parser errors plus renaming most of the sema classes to match that they do now. Some have changes a lot.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Mon, 05 May 2008 18:44:20 +0200 |
parents | 1a24e61eb104 |
children | 48bb2287c035 |
line wrap: on
line diff
--- a/basic/SourceManager.d Mon May 05 17:07:16 2008 +0200 +++ b/basic/SourceManager.d Mon May 05 18:44:20 2008 +0200 @@ -94,13 +94,12 @@ } /** - Extracts a string containing the entire line loc appears in. + Gets the column of where the loc appears. **/ - int getOffsetToLine(SourceLocation loc) + int getColumn(SourceLocation loc) { - // The line is extracted by getting two pointers to the exact location - // and decreasing one until the nearest newline while the other ptr is - // increased to the nearest newline. + // Use same approach as getLine + CP* cp = &checkpoints[loc.fileID]; char* ptr = cp.data.ptr + loc.fileOffset; char* ptr_lo = ptr;