compiler: more precise 'declared and not used' error positioning

* compiler: extract and cleanup error handling functionality into its own file compiler/compile_errors.v

* compiler: implement p.error_with_token_index and p.warn_with_token_index and use them. Fix tests.

* tools/performance_compare: add a 'Source lines in compiler/' line

* MSVC does not have STDOUT_FILENO nor STDERR_FILENO ...
This commit is contained in:
Delyan Angelov 2019-09-29 20:37:39 +03:00 committed by Alexander Medvednikov
parent 6d483c0a56
commit e72fe25224
9 changed files with 303 additions and 241 deletions

View file

@ -97,7 +97,7 @@ mut:
is_c bool // todo remove once `typ` is `Type`, not string
is_moved bool
line_nr int
token Tok // TODO: use only var.token.line_nr, remove var.line_nr
token_idx int // this is a token index, which will be used by error reporting
}
struct Type {