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

compiler: map[string]pointer, ?pointer, fix []pointer

This commit is contained in:
れもん
2019-12-22 07:44:16 +09:00
committed by Alexander Medvednikov
parent b76227b781
commit 28ecfb231d
14 changed files with 98 additions and 48 deletions

View File

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