version: 20190510

This commit is contained in:
superzheng 2019-05-10 16:08:05 +08:00
parent a5b3fdf39d
commit e5d3cc184d
3 changed files with 10 additions and 4 deletions

View File

@ -7,7 +7,7 @@ set(CMAKE_VERBOSE_MAKEFILE off)
# version # version
set(TARS_VERSION "1.1.0") set(TARS_VERSION "1.1.0")
set(PARSER_VERSION "${TARS_VERSION}") set(PARSER_VERSION "${TARS_VERSION}")
set(GENERATOR_VERSION "20190509") set(GENERATOR_VERSION "20190510")
# namespace # namespace
set(IDL_NAMESPACE Tars) set(IDL_NAMESPACE Tars)

Binary file not shown.

View File

@ -180,10 +180,16 @@ string CodeGenerator::getDataType(const TypePtr& pPtr, const bool &bCastEnumAsAn
MapPtr mPtr = MapPtr::dynamicCast(pPtr); MapPtr mPtr = MapPtr::dynamicCast(pPtr);
if (mPtr) 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) + ", " + return IDL_NAMESPACE_STR + "Stream.Map(" + getDataType(mPtr->getLeftTypePtr(), bCastEnumAsAny) + ", " +
getDataType(mPtr->getRightTypePtr(), bCastEnumAsAny) + getDataType(mPtr->getRightTypePtr(), bCastEnumAsAny) + sLeft + sRight + ")";
representArgument(mPtr->getLeftTypePtr()) +
representArgument(mPtr->getRightTypePtr()) + ")";
} }
EnumPtr ePtr = EnumPtr::dynamicCast(pPtr); EnumPtr ePtr = EnumPtr::dynamicCast(pPtr);