diff --git a/CMakeLists.txt b/CMakeLists.txt index 398a7c9..459b8d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_VERBOSE_MAKEFILE off) # version set(TARS_VERSION "1.1.0") set(PARSER_VERSION "${TARS_VERSION}") -set(GENERATOR_VERSION "20190509") +set(GENERATOR_VERSION "20190510") # namespace set(IDL_NAMESPACE Tars) diff --git a/build/tars2node b/build/tars2node index 7fa3bb5..dfa0af0 100755 Binary files a/build/tars2node and b/build/tars2node differ diff --git a/src/idl_util.cpp b/src/idl_util.cpp index 4d101d5..4aaa033 100644 --- a/src/idl_util.cpp +++ b/src/idl_util.cpp @@ -180,10 +180,16 @@ string CodeGenerator::getDataType(const TypePtr& pPtr, const bool &bCastEnumAsAn MapPtr mPtr = MapPtr::dynamicCast(pPtr); if (mPtr) { + string sLeft = representArgument(mPtr->getLeftTypePtr()); + string sRight = representArgument(mPtr->getRightTypePtr()); + + if (sLeft.empty() && !sRight.empty()) + { + sLeft = ", 0"; + } + return IDL_NAMESPACE_STR + "Stream.Map(" + getDataType(mPtr->getLeftTypePtr(), bCastEnumAsAny) + ", " + - getDataType(mPtr->getRightTypePtr(), bCastEnumAsAny) + - representArgument(mPtr->getLeftTypePtr()) + - representArgument(mPtr->getRightTypePtr()) + ")"; + getDataType(mPtr->getRightTypePtr(), bCastEnumAsAny) + sLeft + sRight + ")"; } EnumPtr ePtr = EnumPtr::dynamicCast(pPtr);