diff --git a/DDCore/include/DD4hep/GrammarParsed.h b/DDCore/include/DD4hep/GrammarParsed.h index 9b2c09dd239cc74c00e8d7a1d6faaebcda70b102..553ef22650f4dfe6f21c11e710b51ff4848f6ab5 100644 --- a/DDCore/include/DD4hep/GrammarParsed.h +++ b/DDCore/include/DD4hep/GrammarParsed.h @@ -85,6 +85,16 @@ namespace dd4hep { /// Item evaluator template <typename T> inline int eval_item(T* ptr, std::string val) { + try { + T temp; + int sc = ::dd4hep::Parsers::parse(temp,val); + if ( sc ) { + *ptr = temp; + return 1; + } + } + catch (...) { + } auto result = grammar_evaluate_item(val); if (result.first != tools::Evaluator::OK) { return 0; @@ -272,6 +282,7 @@ namespace dd4hep { namespace dd4hep { namespace detail { \ template<> int grammar_eval<xx>(const BasicGrammar&, void* _p, const std::string& _v) { return func ((xx*)_p,_v); }}} + #define DD4HEP_DEFINE_PARSER_GRAMMAR_INSTANCE(serial,xx) \ namespace dd4hep { \ template class Grammar< xx >; \