diff options
author | Adrian Thurston <thurston@complang.org> | 2014-11-03 12:47:51 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2014-11-03 12:47:51 -0500 |
commit | 236a742024aa0c6042ae05e47e31cf4a208cbf8a (patch) | |
tree | e325a0aae5cf08055dfed38f3c0c2cfa1eb370bc /src/loadcolm.cc | |
parent | 010fe9c06205511c6d3ceb72df85af38adb36646 (diff) | |
download | colm-236a742024aa0c6042ae05e47e31cf4a208cbf8a.tar.gz |
added map2 type, also mapping to ptr of map<>
Diffstat (limited to 'src/loadcolm.cc')
-rw-r--r-- | src/loadcolm.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/loadcolm.cc b/src/loadcolm.cc index e5107d6d..15b900ee 100644 --- a/src/loadcolm.cc +++ b/src/loadcolm.cc @@ -821,6 +821,12 @@ struct LoadColm tr = TypeRef::cons( typeRef.loc(), TypeRef::Map, 0, key, value ); break; } + case type_ref::Map2: { + TypeRef *key = walkTypeRef( typeRef.MapKeyType() ); + TypeRef *value = walkTypeRef( typeRef.MapValueType() ); + tr = TypeRef::cons( typeRef.loc(), TypeRef::Map2, 0, key, value ); + break; + } case type_ref::List: { TypeRef *type = walkTypeRef( typeRef._type_ref() ); tr = TypeRef::cons( typeRef.loc(), TypeRef::List, 0, type, 0 ); @@ -1822,9 +1828,11 @@ struct LoadColm break; } case code_factor::New2: { - TypeRef *listTypeRef = walkTypeRef( codeFactor.type_ref()._type_ref() ); - TypeRef *typeRef = TypeRef::cons( codeFactor.type_ref().loc(), - TypeRef::List, 0, listTypeRef, 0 ); + TypeRef *typeRef = walkTypeRef( codeFactor.type_ref() ); + if ( typeRef->type == TypeRef::List2 ) + typeRef->type = TypeRef::List; + else if ( typeRef->type == TypeRef::Map2 ) + typeRef->type = TypeRef::Map; /* Construct an empty constructor list. */ ConsItemList *list = ConsItemList::cons(); |