Changeset 8d56a6 for src/Actions


Ignore:
Timestamp:
Jun 21, 2018, 8:31:25 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.6.1, ChemicalSpaceEvaluator
Children:
d83d64, f5ea10
Parents:
3e334e (diff), 4fc0ea (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'TremoloParser_IncreasedPrecision' into Candidate_v1.6.1

Conflicts:

tests/Python/ForceAnnealing/post/five_carbon_test_bondgraph.data
tests/Python/ForceAnnealing/post/five_carbon_test_no-bondgraph.data

Location:
src/Actions
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Action.hpp

    r3e334e r8d56a6  
    1414#endif
    1515
     16#include <algorithm>
    1617#include <iosfwd>
    1718#include <string>
     
    2425 */
    2526#define NOPARAM_DEFAULT BOOST_PP_NIL
     27
     28namespace MoleCuilder {
     29  //!> helps normalizing Action's tokens for use as Python parameter names
     30#ifdef HAVE_INLINE
     31  inline
     32#endif
     33  std::string normalizeToken(std::string _token) {
     34    std::replace(_token.begin(), _token.end(), '-', '_');
     35    return _token;
     36  }
     37} /* namespace MoleCuilder */
    2638
    2739/** Nicely visible short-hand for push a status message
  • src/Actions/Action_impl_pre.hpp

    r3e334e r8d56a6  
    173173    output << \
    174174    BOOST_PP_IF(n, ", ", "") \
     175    << normalizeToken( BOOST_PP_SEQ_ELEM(n, paramtokens) ) \
     176    << "=" \
    175177    << "\"" << params. \
    176178        BOOST_PP_SEQ_ELEM(n, paramreferences) \
    177         .getAsStringUnvalidated() \
    178     << "\"";
     179          .getAsStringUnvalidated() \
     180    << "\""; \
    179181
    180182// print an initialiser list, i.e. "var( token, valid (,default) )(,)"
  • src/Actions/Action_impl_python.hpp

    r3e334e r8d56a6  
    7777  BOOST_PP_COMMA_IF(n) \
    7878  boost::python::arg( \
    79   BOOST_PP_SEQ_ELEM(n, STRINGLIST) \
     79                  MoleCuilder::normalizeToken( BOOST_PP_SEQ_ELEM(n, STRINGLIST) ).c_str() \
    8080  ) \
    8181  = \
     
    9292  BOOST_PP_COMMA_IF(n) \
    9393  boost::python::arg( \
    94   BOOST_PP_SEQ_ELEM(n, STRINGLIST) \
     94                  MoleCuilder::normalizeToken( BOOST_PP_SEQ_ELEM(n, STRINGLIST) ).c_str() \
    9595  )
    9696
  • src/Actions/MakroAction_impl_pre.hpp

    r3e334e r8d56a6  
    165165    output << \
    166166    BOOST_PP_IF(n, ", ", "") \
     167          << normalizeToken( BOOST_PP_SEQ_ELEM(n, paramtokens) ) \
     168          << "=" \
    167169    << "\"" << params. \
    168170        BOOST_PP_SEQ_ELEM(n, paramreferences) \
Note: See TracChangeset for help on using the changeset viewer.