mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
in errors, print array_ instead of [] in function names
This commit is contained in:
parent
cba6a6fdea
commit
25beb7b3f4
@ -190,13 +190,20 @@ fn (p mut Parser) print_error_context() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn normalized_error(s string) string {
|
fn normalized_error(s string) string {
|
||||||
// Print `[]int` instead of `array_int` in errors
|
mut res := s
|
||||||
mut res := s.replace('array_', '[]').replace('__', '.')
|
if !res.contains('__') {
|
||||||
.replace('Option_', '?').replace('main.', '').replace('ptr_', '&')
|
// `[]int` instead of `array_int`
|
||||||
.replace('_dot_', '.')
|
res = res.replace('array_', '[]')
|
||||||
|
}
|
||||||
|
res = res.replace('__', '.')
|
||||||
|
res = res.replace('Option_', '?')
|
||||||
|
res = res.replace('main.', '')
|
||||||
|
res = res.replace('ptr_', '&')
|
||||||
|
res = res.replace('_dot_', '.')
|
||||||
if res.contains('_V_MulRet_') {
|
if res.contains('_V_MulRet_') {
|
||||||
res = res.replace('_V_MulRet_', '(').replace('_V_', ', ')
|
res = res.replace('_V_MulRet_', '(')
|
||||||
res = res[..res.len - 1] + ')"'
|
res = res.replace('_V_', ', ')
|
||||||
|
res = res[..res.len - 1] + ')"' //"// quote balance comment. do not remove
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user