scanner: remove unused .line_ends field
parent
bc3827ae15
commit
f79bc8619a
|
@ -45,7 +45,6 @@ pub mut:
|
||||||
is_print_rel_paths_on_error bool
|
is_print_rel_paths_on_error bool
|
||||||
quote byte // which quote is used to denote current string: ' or "
|
quote byte // which quote is used to denote current string: ' or "
|
||||||
inter_quote byte
|
inter_quote byte
|
||||||
line_ends []int // the positions of source lines ends (i.e. \n signs)
|
|
||||||
nr_lines int // total number of lines in the source file that were scanned
|
nr_lines int // total number of lines in the source file that were scanned
|
||||||
is_vh bool // Keep newlines
|
is_vh bool // Keep newlines
|
||||||
is_fmt bool // Used for v fmt.
|
is_fmt bool // Used for v fmt.
|
||||||
|
@ -512,6 +511,11 @@ fn (mut s Scanner) ident_number() string {
|
||||||
fn (mut s Scanner) skip_whitespace() {
|
fn (mut s Scanner) skip_whitespace() {
|
||||||
for s.pos < s.text.len {
|
for s.pos < s.text.len {
|
||||||
c := s.text[s.pos]
|
c := s.text[s.pos]
|
||||||
|
if c == 8 {
|
||||||
|
// tabs are most common
|
||||||
|
s.pos++
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !(c == 32 || (c > 8 && c < 14) || (c == 0x85) || (c == 0xa0)) {
|
if !(c == 32 || (c > 8 && c < 14) || (c == 0x85) || (c == 0xa0)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1354,7 +1358,6 @@ fn (mut s Scanner) inc_line_number() {
|
||||||
s.last_nl_pos++
|
s.last_nl_pos++
|
||||||
}
|
}
|
||||||
s.line_nr++
|
s.line_nr++
|
||||||
s.line_ends << s.pos
|
|
||||||
if s.line_nr > s.nr_lines {
|
if s.line_nr > s.nr_lines {
|
||||||
s.nr_lines = s.line_nr
|
s.nr_lines = s.line_nr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue