[ast] fix missing cases after 603f3ba1 35/21135/1
St├ęphane MOTTELET [Thu, 21 Nov 2019 09:00:00 +0000 (10:00 +0100)]
-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

scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp
scilab/modules/ast/src/cpp/types/tostring_common.cpp

index b139878..20f6ba1 100644 (file)
@@ -237,7 +237,10 @@ void RunVisitorT<T>::visitprivate(const AssignExp  &e)
                 {
                     std::wostringstream ostr;
                     ostr << L" " << *getStructNameFromExp(pCell) << L"  = " << std::endl;
-                    ostr << std::endl;
+                    if (ConfigVariable::isPrintCompact() == false)
+                    {
+                        ostr << std::endl;                
+                    }
                     scilabWriteW(ostr.str().c_str());
 
                     VariableToString(pOut, ostr.str().c_str());
@@ -407,7 +410,10 @@ void RunVisitorT<T>::visitprivate(const AssignExp  &e)
             {
                 std::wostringstream ostr;
                 ostr << L" " << *getStructNameFromExp(&pCall->getName()) << L"  = " << std::endl;
-                ostr << std::endl;
+                if (ConfigVariable::isPrintCompact() == false)
+                {
+                    ostr << std::endl;                
+                }
                 scilabWriteW(ostr.str().c_str());
 
                 std::wostringstream ostrName;
@@ -549,7 +555,11 @@ void RunVisitorT<T>::visitprivate(const AssignExp  &e)
 
                 types::InternalType* pPrint = ctx->get(symbol::Symbol(*pstName));
                 std::wostringstream ostr;
-                ostr << L" " << *pstName << L"  = " << std::endl << std::endl;
+                ostr << L" " << *pstName << L"  = " << std::endl;
+                if (ConfigVariable::isPrintCompact() == false)
+                {
+                    ostr << std::endl;                
+                }
                 scilabWriteW(ostr.str().c_str());
 
                 std::wostringstream ostrName;
index 0badf9e..cf45135 100644 (file)
@@ -397,7 +397,7 @@ void configureStream(std::wostringstream * _postr, int _iWidth, int _iPrec, char
 
 void addColumnString(std::wostringstream& ostr, int _iFrom, int _iTo)
 {
-    if (ConfigVariable::isPrintCompact() == false)
+    if (ConfigVariable::isPrintCompact() == false && _iFrom != 1)
     {
         ostr << std::endl;
     }