vet: prohibit spaces before `)`

pull/5801/head
Alexander Medvednikov 2020-07-11 12:14:10 +02:00
parent 54da8371ac
commit 2a696cb837
1 changed files with 4 additions and 0 deletions

View File

@ -779,6 +779,10 @@ fn (mut s Scanner) text_scan() token.Token {
return s.new_token(.lpar, '', 1)
}
`)` {
// TODO `$if vet {` for performance
if s.pref.is_vet && s.text[s.pos - 1] == ` ` {
println('$s.file_path:$s.line_nr: Looks like you are adding a space before `)`')
}
return s.new_token(.rpar, '', 1)
}
`[` {