summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSt├ęphane MOTTELET <stephane.mottelet@utc.fr>2019-11-21 10:00:00 +0100
committerSt├ęphane MOTTELET <stephane.mottelet@utc.fr>2019-11-21 10:00:14 +0100
commitd9e09370807096d7a74057abc9d99f34d704278b (patch)
treea14924aa14f0334ad7de4898e8e6661851061da5
parentc1f299d7479323d2928302da8de3a7a81bbbfee0 (diff)
downloadscilab-d9e09370807096d7a74057abc9d99f34d704278b.zip
scilab-d9e09370807096d7a74057abc9d99f34d704278b.tar.gz
[ast] fix missing cases after 603f3ba1
-a(...) without fields or whatever on arrayof derived types -first line display of addColumnString added a spurious std::endl in mode(1). Change-Id: I5fe0fe185e97b8458f70a450f0731d7c78945ee4
-rw-r--r--scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp16
-rw-r--r--scilab/modules/ast/src/cpp/types/tostring_common.cpp2
2 files changed, 14 insertions, 4 deletions
diff --git a/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp b/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
index b139878..20f6ba1 100644
--- a/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
+++ b/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
@@ -237,7 +237,10 @@ void RunVisitorT<T>::visitprivate(const AssignExp &e)
237 { 237 {
238 std::wostringstream ostr; 238 std::wostringstream ostr;
239 ostr << L" " << *getStructNameFromExp(pCell) << L" = " << std::endl; 239 ostr << L" " << *getStructNameFromExp(pCell) << L" = " << std::endl;
240 ostr << std::endl; 240 if (ConfigVariable::isPrintCompact() == false)
241 {
242 ostr << std::endl;
243 }
241 scilabWriteW(ostr.str().c_str()); 244 scilabWriteW(ostr.str().c_str());
242 245
243 VariableToString(pOut, ostr.str().c_str()); 246 VariableToString(pOut, ostr.str().c_str());
@@ -407,7 +410,10 @@ void RunVisitorT<T>::visitprivate(const AssignExp &e)
407 { 410 {
408 std::wostringstream ostr; 411 std::wostringstream ostr;
409 ostr << L" " << *getStructNameFromExp(&pCall->getName()) << L" = " << std::endl; 412 ostr << L" " << *getStructNameFromExp(&pCall->getName()) << L" = " << std::endl;
410 ostr << std::endl; 413 if (ConfigVariable::isPrintCompact() == false)
414 {
415 ostr << std::endl;
416 }
411 scilabWriteW(ostr.str().c_str()); 417 scilabWriteW(ostr.str().c_str());
412 418
413 std::wostringstream ostrName; 419 std::wostringstream ostrName;
@@ -549,7 +555,11 @@ void RunVisitorT<T>::visitprivate(const AssignExp &e)
549 555
550 types::InternalType* pPrint = ctx->get(symbol::Symbol(*pstName)); 556 types::InternalType* pPrint = ctx->get(symbol::Symbol(*pstName));
551 std::wostringstream ostr; 557 std::wostringstream ostr;
552 ostr << L" " << *pstName << L" = " << std::endl << std::endl; 558 ostr << L" " << *pstName << L" = " << std::endl;
559 if (ConfigVariable::isPrintCompact() == false)
560 {
561 ostr << std::endl;
562 }
553 scilabWriteW(ostr.str().c_str()); 563 scilabWriteW(ostr.str().c_str());
554 564
555 std::wostringstream ostrName; 565 std::wostringstream ostrName;
diff --git a/scilab/modules/ast/src/cpp/types/tostring_common.cpp b/scilab/modules/ast/src/cpp/types/tostring_common.cpp
index 0badf9e..cf45135 100644
--- a/scilab/modules/ast/src/cpp/types/tostring_common.cpp
+++ b/scilab/modules/ast/src/cpp/types/tostring_common.cpp
@@ -397,7 +397,7 @@ void configureStream(std::wostringstream * _postr, int _iWidth, int _iPrec, char
397 397
398void addColumnString(std::wostringstream& ostr, int _iFrom, int _iTo) 398void addColumnString(std::wostringstream& ostr, int _iFrom, int _iTo)
399{ 399{
400 if (ConfigVariable::isPrintCompact() == false) 400 if (ConfigVariable::isPrintCompact() == false && _iFrom != 1)
401 { 401 {
402 ostr << std::endl; 402 ostr << std::endl;
403 } 403 }