diff options
author | Jose <jose@zeroc.com> | 2018-08-09 18:51:20 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-08-09 18:51:20 +0200 |
commit | 0ea594d6080f5561ba3b45c40547a9d84ba2209d (patch) | |
tree | f966779dc1c7ddea7702b5dfbefd1975b5b29e04 /cpp/src/Slice | |
parent | PHP5 test failures (diff) | |
download | ice-0ea594d6080f5561ba3b45c40547a9d84ba2209d.tar.bz2 ice-0ea594d6080f5561ba3b45c40547a9d84ba2209d.tar.xz ice-0ea594d6080f5561ba3b45c40547a9d84ba2209d.zip |
Ruby Ice::loadSlice only works on global scope
Close #173
Diffstat (limited to 'cpp/src/Slice')
-rw-r--r-- | cpp/src/Slice/RubyUtil.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp index f20568064c0..b9a2ddbc3ce 100644 --- a/cpp/src/Slice/RubyUtil.cpp +++ b/cpp/src/Slice/RubyUtil.cpp @@ -191,7 +191,16 @@ Slice::Ruby::CodeVisitor::CodeVisitor(Output& out) : bool Slice::Ruby::CodeVisitor::visitModuleStart(const ModulePtr& p) { - _out << sp << nl << "module " << fixIdent(p->name(), IdentToUpper); + _out << sp << nl << "module "; + // + // Ensure that Slice top-level modules are defined as top + // level modules in Ruby + // + if(UnitPtr::dynamicCast(p->container())) + { + _out << "::"; + } + _out << fixIdent(p->name(), IdentToUpper); _out.inc(); return true; } |