Skip to content

Commit ad24dbd

Browse files
authored
v.scanner: remove Scanner.is_started field (#22918)
1 parent 355945e commit ad24dbd

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

vlib/v/scanner/scanner.v

+3-9
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ pub mut:
2626
file_path string // '/path/to/file.v'
2727
file_base string // 'file.v'
2828
text string // the whole text of the file
29-
pos int // current position in the file, first character is s.text[0]
30-
line_nr int // current line number
29+
pos int = -1 // current position in the file, first character is s.text[0]
30+
line_nr int // current line number
3131
last_nl_pos int = -1 // for calculating column
3232
is_crlf bool // special check when computing columns
3333
is_inside_string bool // set to true in a string, *at the start* of an $var or ${expr}
@@ -38,7 +38,6 @@ pub mut:
3838
is_nested_enclosed_inter bool
3939
line_comment string
4040
last_lt int = -1 // position of latest <
41-
is_started bool
4241
is_print_line_on_error bool
4342
is_print_colored_error bool
4443
is_print_rel_paths_on_error bool
@@ -662,11 +661,7 @@ pub fn (mut s Scanner) text_scan() token.Token {
662661
// That optimization mostly matters for long sections
663662
// of comments and string literals.
664663
for {
665-
if s.is_started {
666-
s.pos++
667-
} else {
668-
s.is_started = true
669-
}
664+
s.pos++
670665
if !s.is_inside_string {
671666
s.skip_whitespace()
672667
}
@@ -1839,7 +1834,6 @@ pub fn (mut s Scanner) prepare_for_new_text(text string) {
18391834
s.is_crlf = false
18401835
s.is_inside_string = false
18411836
s.is_nested_string = false
1842-
s.is_started = false
18431837
s.is_inter_start = false
18441838
s.is_inter_end = false
18451839
s.is_enclosed_inter = false

0 commit comments

Comments
 (0)