Skip to content

Commit 099f3a6

Browse files
committed
---
yaml --- r: 36300 b: refs/heads/try2 c: bcccf33 h: refs/heads/master v: v3
1 parent c2b5ef7 commit 099f3a6

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 4a0f4f5e311b7443b29ea31ad0e68e6b4aa63736
8+
refs/heads/try2: bcccf333ab728539bf63ed773e6182f9da33683e
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libsyntax/codemap.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* in a crate. This to make it possible to represent the positions
33
* with single-word things, rather than passing records all over the
44
* compiler.
5+
*
6+
* All represented positions are *absolute* positions within the codemap,
7+
* not relative positions within a single file.
58
*/
69

710
use dvec::DVec;
@@ -142,6 +145,8 @@ pub struct Loc<A: Pos> {
142145
file: @FileMap, line: uint, col: A
143146
}
144147

148+
/// An absolute offset within the CodeMap (not a relative offset within a
149+
/// a single FileMap)
145150
pub struct FilePos {
146151
ch: CharPos, byte: BytePos
147152
}

branches/try2/src/libsyntax/parse/lexer.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ trait reader {
2121
type string_reader = @{
2222
span_diagnostic: span_handler,
2323
src: @~str,
24+
// The absolute offset within the codemap of the next character to read
2425
mut pos: FilePos,
26+
// The absolute offset within the codemap of the last character to be read (curr)
2527
mut last_pos: FilePos,
28+
// The column of the next character to read
2629
mut col: CharPos,
30+
// The last character to be read
2731
mut curr: char,
2832
filemap: @codemap::FileMap,
2933
interner: @token::ident_interner,

0 commit comments

Comments
 (0)