table: Type str()

pull/3929/head
Alexander Medvednikov 2020-03-03 18:38:41 +01:00
parent 2a99422386
commit 823b8ad244
1 changed files with 5 additions and 0 deletions

View File

@ -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