mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
check unused and unmodified vars in all modules, not just main
This commit is contained in:
parent
bdaa421e8a
commit
c8d111924d
31 changed files with 133 additions and 119 deletions
|
@ -213,8 +213,8 @@ fn (s mut Scanner) goto_scanner_position(scp ScannerPos) {
|
|||
s.last_nl_pos = scp.last_nl_pos
|
||||
}
|
||||
|
||||
fn (s mut Scanner) get_last_nl_from_pos(_pos int) int {
|
||||
mut pos := if _pos >= s.text.len { s.text.len-1 } else { _pos }
|
||||
fn (s &Scanner) get_last_nl_from_pos(_pos int) int {
|
||||
pos := if _pos >= s.text.len { s.text.len-1 } else { _pos }
|
||||
for i := pos; i >= 0; i-- {
|
||||
if s.text[i] == `\n` {
|
||||
return i
|
||||
|
@ -223,7 +223,7 @@ fn (s mut Scanner) get_last_nl_from_pos(_pos int) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
fn (s mut Scanner) get_scanner_pos_of_token(tok &Token) ScannerPos {
|
||||
fn (s &Scanner) get_scanner_pos_of_token(tok &Token) ScannerPos {
|
||||
return ScannerPos{
|
||||
pos: tok.pos
|
||||
line_nr: tok.line_nr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue