mirror of
https://github.com/tars-node/tars2node.git
synced 2024-03-22 13:10:56 +08:00
version: 20190529
This commit is contained in:
parent
24c9b8c988
commit
06e007481f
|
@ -7,7 +7,7 @@ set(CMAKE_VERBOSE_MAKEFILE off)
|
|||
# version
|
||||
set(TARS_VERSION "1.1.0")
|
||||
set(PARSER_VERSION "${TARS_VERSION}")
|
||||
set(GENERATOR_VERSION "20190516")
|
||||
set(GENERATOR_VERSION "20190529")
|
||||
|
||||
# namespace
|
||||
set(IDL_NAMESPACE Tars)
|
||||
|
|
BIN
build/tars2node
BIN
build/tars2node
Binary file not shown.
|
@ -30,16 +30,6 @@ string CodeGenerator::printHeaderRemark(const string &sTypeName)
|
|||
return s.str();
|
||||
}
|
||||
|
||||
string CodeGenerator::printHeaderRemark(const string &sTypeName, const string &sSuffix)
|
||||
{
|
||||
ostringstream s;
|
||||
s << printHeaderRemark(sTypeName);
|
||||
s << sSuffix << endl;
|
||||
s << endl;
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
void CodeGenerator::createFile(const string &file, const bool bEntry)
|
||||
{
|
||||
_sIdlFile = getRealFileInfo(file);
|
||||
|
|
|
@ -283,8 +283,6 @@ private:
|
|||
|
||||
string printHeaderRemark(const string &sTypeName);
|
||||
|
||||
string printHeaderRemark(const string &sTypeName, const string &sSuffix);
|
||||
|
||||
private:
|
||||
string _sRpcPath;
|
||||
|
||||
|
|
|
@ -416,7 +416,9 @@ bool CodeGenerator::generateJS(const ContextPtr &pPtr)
|
|||
|
||||
// concat generated code
|
||||
ostringstream sstr;
|
||||
sstr << printHeaderRemark("Structure", DISABLE_ESLINT);
|
||||
sstr << printHeaderRemark("Structure");
|
||||
sstr << DISABLE_ESLINT << endl;
|
||||
sstr << endl;
|
||||
sstr << "\"use strict\";" << endl << endl;
|
||||
if (bNeedAssert)
|
||||
{
|
||||
|
|
|
@ -229,7 +229,10 @@ void CodeGenerator::generateDTS(const ContextPtr &pPtr)
|
|||
|
||||
// concat generated code
|
||||
ostringstream sstr;
|
||||
sstr << printHeaderRemark("Structure", DISABLE_TSLINT);
|
||||
sstr << printHeaderRemark("Structure");
|
||||
sstr << DISABLE_TSLINT << endl;
|
||||
sstr << DISABLE_ESLINT << endl;
|
||||
sstr << endl;
|
||||
sstr << ostr.str() << endl;
|
||||
sstr << estr.str() << endl;
|
||||
|
||||
|
|
|
@ -479,7 +479,9 @@ bool CodeGenerator::generateJSProxy(const ContextPtr &cPtr)
|
|||
|
||||
// concat generated code
|
||||
ostringstream sstr;
|
||||
sstr << printHeaderRemark("Client", DISABLE_ESLINT);
|
||||
sstr << printHeaderRemark("Client");
|
||||
sstr << DISABLE_ESLINT << endl;
|
||||
sstr << endl;
|
||||
sstr << "\"use strict\";" << endl << endl;
|
||||
if (bNeedAssert)
|
||||
{
|
||||
|
|
|
@ -130,7 +130,10 @@ void CodeGenerator::generateDTSProxy(const ContextPtr &cPtr)
|
|||
|
||||
// concat generated code
|
||||
ostringstream sstr;
|
||||
sstr << printHeaderRemark("Client", DISABLE_TSLINT);
|
||||
sstr << printHeaderRemark("Client");
|
||||
sstr << DISABLE_TSLINT << endl;
|
||||
sstr << DISABLE_ESLINT << endl;
|
||||
sstr << endl;
|
||||
if (bNeedStream)
|
||||
{
|
||||
sstr << "import * as " << IDL_NAMESPACE_STR << "Stream from \"" << _sStreamPath << "\";" << endl;
|
||||
|
|
|
@ -427,7 +427,10 @@ bool CodeGenerator::generateTSProxy(const ContextPtr &cPtr)
|
|||
|
||||
// generate module imports
|
||||
ostringstream sstr;
|
||||
sstr << printHeaderRemark("Client", DISABLE_TSLINT);
|
||||
sstr << printHeaderRemark("Client");
|
||||
sstr << DISABLE_TSLINT << endl;
|
||||
sstr << DISABLE_ESLINT << endl;
|
||||
sstr << endl;
|
||||
sstr << "/// <reference types=\"node\" />" << endl;
|
||||
if (bNeedAssert)
|
||||
{
|
||||
|
|
|
@ -372,7 +372,9 @@ bool CodeGenerator::generateJSServer(const ContextPtr &pPtr)
|
|||
|
||||
ostringstream str;
|
||||
|
||||
str << printHeaderRemark("Server", DISABLE_ESLINT);
|
||||
str << printHeaderRemark("Server");
|
||||
str << DISABLE_ESLINT << endl;
|
||||
str << endl;
|
||||
str << "\"use strict\";" << endl << endl;
|
||||
str << ostr.str() << endl;
|
||||
str << istr.str();
|
||||
|
|
|
@ -144,7 +144,10 @@ void CodeGenerator::generateDTSServer(const ContextPtr &pPtr)
|
|||
}
|
||||
|
||||
ostringstream str;
|
||||
str << printHeaderRemark("Server", DISABLE_TSLINT);
|
||||
str << printHeaderRemark("Server");
|
||||
str << DISABLE_TSLINT << endl;
|
||||
str << DISABLE_ESLINT << endl;
|
||||
str << endl;
|
||||
str << ostr.str() << endl;
|
||||
str << estr.str() << endl;
|
||||
|
||||
|
|
|
@ -361,7 +361,10 @@ bool CodeGenerator::generateTSServer(const ContextPtr &pPtr)
|
|||
ostringstream str;
|
||||
|
||||
// generate the source file
|
||||
str << printHeaderRemark("Server", DISABLE_TSLINT);
|
||||
str << printHeaderRemark("Server");
|
||||
str << DISABLE_TSLINT << endl;
|
||||
str << DISABLE_ESLINT << endl;
|
||||
str << endl;
|
||||
str << "/// <reference types=\"node\" />" << endl;
|
||||
if (bNeedAssert)
|
||||
{
|
||||
|
|
|
@ -431,7 +431,10 @@ void CodeGenerator::generateTS(const ContextPtr &pPtr)
|
|||
|
||||
// concat generated code
|
||||
ostringstream sstr;
|
||||
sstr << printHeaderRemark("Structure", DISABLE_TSLINT);
|
||||
sstr << printHeaderRemark("Structure");
|
||||
sstr << DISABLE_TSLINT << endl;
|
||||
sstr << DISABLE_ESLINT << endl;
|
||||
sstr << endl;
|
||||
sstr << "/// <reference types=\"node\" />" << endl;
|
||||
sstr << ostr.str() << endl;
|
||||
sstr << estr.str() << endl;
|
||||
|
|
Loading…
Reference in New Issue
Block a user