Salome HOME
projects
/
modules
/
med.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copyright update 2022
[modules/med.git]
/
src
/
MEDCalculator
/
Swig
/
SPythonInterpreter.cxx
diff --git
a/src/MEDCalculator/Swig/SPythonInterpreter.cxx
b/src/MEDCalculator/Swig/SPythonInterpreter.cxx
index 2b24e5d8acc1e01b18148d4c66a553fc5462eed0..5a0b5b6dfcf997bb4f1dfcf01ec2c036d7c5c942 100644
(file)
--- a/
src/MEDCalculator/Swig/SPythonInterpreter.cxx
+++ b/
src/MEDCalculator/Swig/SPythonInterpreter.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
14
CEA/DEN, EDF R&D
+// Copyright (C) 2007-20
22
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
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-25,7
+25,7
@@
#include <sstream>
#include <algorithm>
#include <sstream>
#include <algorithm>
-using namespace
ParaMEDMEM
;
+using namespace
MEDCoupling
;
const char *SPythonInterpreter::INDENT_TOKEN[]={"def","class","for","if","while","try","except"};
const char *SPythonInterpreter::INDENT_TOKEN[]={"def","class","for","if","while","try","except"};
@@
-193,12
+193,14
@@
bool SPythonInterpreter::isSPythonExpression(const std::string& s)
return false;
if(w.find("del ")!=std::string::npos)
return false;
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;
bool isPrint=w.find(PRINT)!=std::string::npos;
+ isPrint &= w.find(ENDPRINT)!=std::string::npos;
if(isPrint)
{
std::size_t p=w.find(PRINT);
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))
}
std::string result;
if(!isSPythonExpressionLev1(w,result))