mirror of https://github.com/KLayout/klayout.git
Avoiding one invalid error message
This commit is contained in:
parent
90edfab9ae
commit
4222de9034
|
|
@ -123,10 +123,12 @@ public:
|
||||||
|
|
||||||
void register_gsi (const char *name)
|
void register_gsi (const char *name)
|
||||||
{
|
{
|
||||||
|
m_name = name;
|
||||||
|
|
||||||
// do not register an interpreter again (this is important as registration code
|
// do not register an interpreter again (this is important as registration code
|
||||||
// may be executed again and we do not want to have two interpreters for the same thing)
|
// may be executed again and we do not want to have two interpreters for the same thing)
|
||||||
for (tl::Registrar<lym::MacroInterpreter>::iterator cls = tl::Registrar<lym::MacroInterpreter>::begin (); cls != tl::Registrar<lym::MacroInterpreter>::end (); ++cls) {
|
for (tl::Registrar<lym::MacroInterpreter>::iterator cls = tl::Registrar<lym::MacroInterpreter>::begin (); cls != tl::Registrar<lym::MacroInterpreter>::end (); ++cls) {
|
||||||
if (cls.current_name () == name) {
|
if (cls.current_name () == m_name) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -137,8 +139,6 @@ public:
|
||||||
// cancel any previous registration and register (again)
|
// cancel any previous registration and register (again)
|
||||||
delete mp_registration;
|
delete mp_registration;
|
||||||
mp_registration = new tl::RegisteredClass<lym::MacroInterpreter> (this, 0 /*position*/, name, false /*does not own object*/);
|
mp_registration = new tl::RegisteredClass<lym::MacroInterpreter> (this, 0 /*position*/, name, false /*does not own object*/);
|
||||||
|
|
||||||
m_name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual tl::Executable *executable (const lym::Macro *macro) const
|
virtual tl::Executable *executable (const lym::Macro *macro) const
|
||||||
|
|
@ -212,7 +212,7 @@ public:
|
||||||
|
|
||||||
lym::Macro *create_template (const std::string &url)
|
lym::Macro *create_template (const std::string &url)
|
||||||
{
|
{
|
||||||
if (! mp_registration) {
|
if (m_name.empty ()) {
|
||||||
throw std::runtime_error (tl::to_string (tr ("MacroInterpreter::create_template must be called after register")));
|
throw std::runtime_error (tl::to_string (tr ("MacroInterpreter::create_template must be called after register")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue