fn advanceSourceCursor(astgen: *AstGen, end: usize) void astgen: *AstGenend: usize12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869fn advanceSourceCursor(astgen: *AstGen, end: usize) void {
const source = astgen.tree.source;
var i = astgen.source_offset;
var line = astgen.source_line;
var column = astgen.source_column;
assert(i <= end);
while (i < end) : (i += 1) {
if (source[i] == '\n') {
line += 1;
column = 0;
} else {
column += 1;
}
}
astgen.source_offset = i;
astgen.source_line = line;
astgen.source_column = column;
}
Advances the source cursor to an absolute byte offset
endin the file.