1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

View File

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