From 823b8ad244c7b4bdc7081023791139793d9ff3d2 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 3 Mar 2020 18:38:41 +0100 Subject: [PATCH] table: Type str() --- vlib/v/table/atype_symbols.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vlib/v/table/atype_symbols.v b/vlib/v/table/atype_symbols.v index c7858b724a..cbb866e7f1 100644 --- a/vlib/v/table/atype_symbols.v +++ b/vlib/v/table/atype_symbols.v @@ -89,6 +89,10 @@ pub enum Kind { enum_ } +pub fn (t &TypeSymbol) str() string { + return t.name.replace('array_', '[]') +} + [inline] pub fn (t &TypeSymbol) enum_info() Enum { match t.info { @@ -155,6 +159,7 @@ pub fn (t TypeSymbol) str() string { } */ + pub fn (t mut Table) register_builtin_type_symbols() { // reserve index 0 so nothing can go there // save index check, 0 will mean not found