Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

search symbols in runtime scope

  • Loading branch information...
commit 772732455932e5a6df5b11606c0f5fe015451c8d 1 parent 7ee6213
@NotFound authored
View
2  winxedxx.winxed
@@ -760,7 +760,7 @@ function emit_CallExpr(out, callexpr)
if (sym != null)
out.print(callname);
else
- out.print("wxxGetCurrentNamespace().get(\"", callname, "\")");
+ out.print("wxxGetCurrentNamespace().find_symbol(\"", callname, "\")");
}
break;
default:
View
12 winxedxx_namespace.cxx
@@ -33,6 +33,18 @@ WxxObjectPtr WxxNamespace::get(const std::string &name)
return WxxObjectPtr(it->second);
}
+WxxObjectPtr WxxNamespace::find_symbol(const std::string &name)
+{
+ symbols_t::const_iterator it = symbols.find(name);
+ if (it == symbols.end()) {
+ if (parentns)
+ return parentns->find_symbol(name);
+ else
+ return winxedxxnull;
+ }
+ return WxxObjectPtr(it->second);
+}
+
WxxNamespace &WxxNamespace::childNamespace(const std::string &name)
{
childs_t::const_iterator it = childs.find(name);
View
1  winxedxx_namespace.h
@@ -25,6 +25,7 @@ class WxxNamespace : public WxxDefault
void operator = (const WxxNamespace &);
public:
WxxObjectPtr get(const std::string &name);
+ WxxObjectPtr find_symbol(const std::string &name);
WxxNamespace &childNamespace(const std::string &name);
void set(const std::string &name, const WxxObjectPtr &value);
private:
Please sign in to comment.
Something went wrong with that request. Please try again.