scanner: treat warnings as errors on -W too, simillar to the parser

pull/7119/head
Delyan Angelov 2020-12-04 15:11:35 +02:00
parent d60f148b0c
commit 7a8d6a7c7b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 4 additions and 0 deletions

View File

@ -1207,6 +1207,10 @@ fn (mut s Scanner) inc_line_number() {
} }
pub fn (mut s Scanner) warn(msg string) { pub fn (mut s Scanner) warn(msg string) {
if s.pref.warns_are_errors {
s.error(msg)
return
}
pos := token.Position{ pos := token.Position{
line_nr: s.line_nr line_nr: s.line_nr
pos: s.pos pos: s.pos