-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <sstream>
#include <algorithm>
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const char *SPythonInterpreter::INDENT_TOKEN[]={"def","class","for","if","while","try","except"};
return false;
if(w.find("del ")!=std::string::npos)
return false;
- const char PRINT[]="print ";
+ const char PRINT[]="print(";
+ const char ENDPRINT[]=")";
bool isPrint=w.find(PRINT)!=std::string::npos;
+ isPrint &= w.find(ENDPRINT)!=std::string::npos;
if(isPrint)
{
std::size_t p=w.find(PRINT);
- w=w.substr(p+sizeof(PRINT)-1);
+ w=w.substr(p+sizeof(PRINT)-sizeof(ENDPRINT)-1);
}
std::string result;
if(!isSPythonExpressionLev1(w,result))