summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane MOTTELET <stephane.mottelet@utc.fr>2019-09-18 19:18:03 +0200
committerClément DAVID <clement.david@esi-group.com>2019-11-19 22:03:05 +0100
commit603f3ba125eaae68c7019bf97ad24bc45befe6c8 (patch)
tree2613085f313df55c508d4a9f18bb2876e8d5e7ea
parentcea4414fb4690231f225773f29c88776c6dfa23a (diff)
downloadscilab-603f3ba125eaae68c7019bf97ad24bc45befe6c8.zip
scilab-603f3ba125eaae68c7019bf97ad24bc45befe6c8.tar.gz
* Bug 16191 fixed: now mode(0) and mode(1) are really compact.
https://bugzilla.scilab.org/show_bug.cgi?id=16191 Change-Id: Ib69a6d17d2da00c64be28fa0ca79b6ba319c0efe
-rw-r--r--scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp6
-rw-r--r--scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp6
-rw-r--r--scilab/modules/ast/src/cpp/ast/runvisitor.cpp5
-rw-r--r--scilab/modules/ast/src/cpp/types/tostring_common.cpp12
-rw-r--r--scilab/modules/ast/src/cpp/types/types_tools.cpp5
5 files changed, 24 insertions, 10 deletions
diff --git a/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp b/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
index c278e2d..b139878 100644
--- a/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
+++ b/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
@@ -137,7 +137,11 @@ void RunVisitorT<T>::visitprivate(const AssignExp &e)
137 { 137 {
138 std::wstring wstrName = pVar->getSymbol().getName(); 138 std::wstring wstrName = pVar->getSymbol().getName();
139 std::wostringstream ostr; 139 std::wostringstream ostr;
140 ostr << L" " << wstrName << L" = " << std::endl << std::endl; 140 ostr << L" " << wstrName << L" = " << std::endl;
141 if (ConfigVariable::isPrintCompact() == false)
142 {
143 ostr << std::endl;
144 }
141 scilabWriteW(ostr.str().c_str()); 145 scilabWriteW(ostr.str().c_str());
142 std::wostringstream ostrName; 146 std::wostringstream ostrName;
143 ostrName << wstrName; 147 ostrName << wstrName;
diff --git a/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp b/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp
index 1af4664..b04f4bf 100644
--- a/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp
+++ b/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp
@@ -191,7 +191,11 @@ void RunVisitorT<T>::visitprivate(const SeqExp &e)
191 if ((*it)->isVerbose() && ConfigVariable::isPrintOutput()) 191 if ((*it)->isVerbose() && ConfigVariable::isPrintOutput())
192 { 192 {
193 //TODO manage multiple returns 193 //TODO manage multiple returns
194 scilabWriteW(L" ans =\n\n"); 194 scilabWriteW(L" ans =\n");
195 if (ConfigVariable::isPrintCompact() == false)
196 {
197 scilabWriteW(L"\n");
198 }
195 std::wostringstream ostrName; 199 std::wostringstream ostrName;
196 ostrName << L"ans"; 200 ostrName << L"ans";
197 VariableToString(pITAns, ostrName.str().c_str()); 201 VariableToString(pITAns, ostrName.str().c_str());
diff --git a/scilab/modules/ast/src/cpp/ast/runvisitor.cpp b/scilab/modules/ast/src/cpp/ast/runvisitor.cpp
index 24ec1f7..dc7d63d 100644
--- a/scilab/modules/ast/src/cpp/ast/runvisitor.cpp
+++ b/scilab/modules/ast/src/cpp/ast/runvisitor.cpp
@@ -126,7 +126,10 @@ void RunVisitorT<T>::visitprivate(const SimpleVar & e)
126 ostr << L"(" << pI->getRef() << L")"; 126 ostr << L"(" << pI->getRef() << L")";
127#endif 127#endif
128 ostr << std::endl; 128 ostr << std::endl;
129 ostr << std::endl; 129 if (ConfigVariable::isPrintCompact() == false)
130 {
131 ostr << std::endl;
132 }
130 scilabWriteW(ostr.str().c_str()); 133 scilabWriteW(ostr.str().c_str());
131 std::wostringstream ostrName; 134 std::wostringstream ostrName;
132 ostrName << e.getSymbol().getName(); 135 ostrName << e.getSymbol().getName();
diff --git a/scilab/modules/ast/src/cpp/types/tostring_common.cpp b/scilab/modules/ast/src/cpp/types/tostring_common.cpp
index 38361d1..1084e74 100644
--- a/scilab/modules/ast/src/cpp/types/tostring_common.cpp
+++ b/scilab/modules/ast/src/cpp/types/tostring_common.cpp
@@ -473,13 +473,21 @@ void configureStream(std::wostringstream * _postr, int _iWidth, int _iPrec, char
473 473
474void addColumnString(std::wostringstream& ostr, int _iFrom, int _iTo) 474void addColumnString(std::wostringstream& ostr, int _iFrom, int _iTo)
475{ 475{
476 if (ConfigVariable::isPrintCompact() == false)
477 {
478 ostr << std::endl;
479 }
476 if (_iFrom == _iTo) 480 if (_iFrom == _iTo)
477 { 481 {
478 ostr << std::endl << L" column " << _iFrom << std::endl << std::endl; 482 ostr << L" column " << _iFrom << std::endl;
479 } 483 }
480 else 484 else
481 { 485 {
482 ostr << std::endl << L" column " << _iFrom << L" to " << _iTo << std::endl << std::endl; 486 ostr << L" column " << _iFrom << L" to " << _iTo << std::endl;
487 }
488 if (ConfigVariable::isPrintCompact() == false)
489 {
490 ostr << std::endl;
483 } 491 }
484} 492}
485 493
diff --git a/scilab/modules/ast/src/cpp/types/types_tools.cpp b/scilab/modules/ast/src/cpp/types/types_tools.cpp
index 023cce5..c98fb9e 100644
--- a/scilab/modules/ast/src/cpp/types/types_tools.cpp
+++ b/scilab/modules/ast/src/cpp/types/types_tools.cpp
@@ -988,11 +988,6 @@ types::Function::ReturnValue VariableToString(types::InternalType* pIT, const wc
988 bFinish = linesmore() == 1; 988 bFinish = linesmore() == 1;
989 } 989 }
990 990
991 if (ConfigVariable::isPrintCompact() == false && ConfigVariable::isPrintInput() == false)
992 {
993 ostr << std::endl;
994 }
995
996 scilabForcedWriteW(ostr.str().c_str()); 991 scilabForcedWriteW(ostr.str().c_str());
997 ostr.str(L""); 992 ostr.str(L"");
998 } 993 }