summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/RubyUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/RubyUtil.cpp')
-rw-r--r--cpp/src/Slice/RubyUtil.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index bd995ce21aa..07bdebd46d6 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1738,6 +1738,11 @@ Slice::Ruby::fixIdent(const string& ident, IdentStyle style)
case IdentNormal:
break;
case IdentToUpper:
+ // Special case BEGIN & END for class/module names.
+ if(id == "BEGIN" || id == "END")
+ {
+ return id + "_";
+ }
if(id[0] >= 'a' && id[0] <= 'z')
{
id[0] += 'A' - 'a';