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

better foo must return (int, int) error

This commit is contained in:
Alexander Medvednikov 2019-12-05 18:55:27 +03:00
parent cb46bf314e
commit cca650c655

View File

@ -171,12 +171,17 @@ fn (p mut Parser) print_error_context(){
// p.scanner.debug_tokens()
}
fn normalized_error( s string ) string {
fn normalized_error(s string) string {
// Print `[]int` instead of `array_int` in errors
return s.replace('array_', '[]')
mut res := s.replace('array_', '[]')
.replace('__', '.')
.replace('Option_', '?')
.replace('main.', '')
if res.contains('_V_MulRet_') {
res = res.replace('_V_MulRet_', '(').replace('_V_', ', ')
res = res[..res.len-1] + ')"'
}
return res
}
//////////////////////////////////////////////////////////////////////////////////////////////////