check unused and unmodified vars in all modules, not just main

This commit is contained in:
Alexander Medvednikov 2019-12-06 15:24:53 +03:00
parent bdaa421e8a
commit c8d111924d
31 changed files with 133 additions and 119 deletions

View file

@ -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