Skip to content

Commit c5272f3

Browse files
committed
---
yaml --- r: 33688 b: refs/heads/snap-stage3 c: bcccf33 h: refs/heads/master v: v3
1 parent be770f2 commit c5272f3

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 4a0f4f5e311b7443b29ea31ad0e68e6b4aa63736
4+
refs/heads/snap-stage3: bcccf333ab728539bf63ed773e6182f9da33683e
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)