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

v: support compiler notices. Use them for [deprecated_after: '2021-05-01'] tags

Compiler notices are like warnings, with these differences:
   a) notices use a different color.
   b) notices use a different label.
   c) notices do not prevent compilation with -prod.
   (warnings are converted to errors with -prod)
This commit is contained in:
Delyan Angelov
2021-03-22 19:43:06 +02:00
parent c76c69ec35
commit a00c80b98f
10 changed files with 250 additions and 20 deletions

View File

@@ -61,9 +61,11 @@ fn color(kind string, msg string) string {
}
if kind.contains('error') {
return term.red(msg)
} else {
return term.magenta(msg)
}
if kind.contains('notice') {
return term.yellow(msg)
}
return term.magenta(msg)
}
// formatted_error - `kind` may be 'error' or 'warn'