From 69de88789a8e63b846d1db803cb26a78648d8390 Mon Sep 17 00:00:00 2001 From: Jacques Wagener Date: Fri, 8 Mar 2019 00:14:14 +0200 Subject: [PATCH] Add support for string in source map. --- vdb/source_map.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vdb/source_map.py b/vdb/source_map.py index cac06af..d853e58 100644 --- a/vdb/source_map.py +++ b/vdb/source_map.py @@ -5,9 +5,10 @@ from vyper.parser.global_context import ( GlobalContext ) from vyper.types import ( - get_size_of_type, ByteArrayType, + get_size_of_type, MappingType, + StringType, TupleType ) from vyper import compile_lll @@ -19,6 +20,9 @@ def serialise_var_rec(var_rec): if isinstance(var_rec.typ, ByteArrayType): type_str = 'bytes[%s]' % var_rec.typ.maxlen _size = get_size_of_type(var_rec.typ) * 32 + elif isinstance(var_rec.typ, StringType): + type_str = 'string[%s]' % var_rec.typ.maxlen + _size = get_size_of_type(var_rec.typ) * 32 elif isinstance(var_rec.typ, TupleType): type_str = 'tuple' _size = get_size_of_type(var_rec.typ) * 32