File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 2
2
* in a crate. This to make it possible to represent the positions
3
3
* with single-word things, rather than passing records all over the
4
4
* compiler.
5
+ *
6
+ * All represented positions are *absolute* positions within the codemap,
7
+ * not relative positions within a single file.
5
8
*/
6
9
7
10
use dvec:: DVec ;
@@ -142,6 +145,8 @@ pub struct Loc<A: Pos> {
142
145
file : @FileMap , line : uint , col : A
143
146
}
144
147
148
+ /// An absolute offset within the CodeMap (not a relative offset within a
149
+ /// a single FileMap )
145
150
pub struct FilePos {
146
151
ch: CharPos , byte: BytePos
147
152
}
Original file line number Diff line number Diff line change @@ -21,9 +21,13 @@ trait reader {
21
21
type string_reader = @{
22
22
span_diagnostic : span_handler ,
23
23
src : @~str ,
24
+ // The absolute offset within the codemap of the next character to read
24
25
mut pos : FilePos ,
26
+ // The absolute offset within the codemap of the last character to be read (curr)
25
27
mut last_pos : FilePos ,
28
+ // The column of the next character to read
26
29
mut col : CharPos ,
30
+ // The last character to be read
27
31
mut curr : char ,
28
32
filemap : @codemap:: FileMap ,
29
33
interner : @token:: ident_interner ,
You can’t perform that action at this time.
0 commit comments