Make the Smalltalk generator use non-hardcoded namespaces.
- Make the Smalltalk generator use program->get_namespace("smalltalk.*")
instead of program->get_smalltalk_{category|prefix}()
- Eliminate the explicit "smalltalk_{category|prefix}" in t_program.
- Deprecate the smalltalk_{category|prefix} tokens.
- Update example .thrift files and syntax files.
This was a little more complex than the others. We now convert "." to "-"
in Smalltalk categories, because we no longer lex them as tok_st_identifier.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665601 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index db4a4a8..36b9316 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -298,18 +298,22 @@
g_program->set_ruby_namespace($2);
}
}
+/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
| tok_smalltalk_category tok_st_identifier
{
+ pwarning(1, "'smalltalk_category' is deprecated. Use 'namespace smalltalk.category' instead");
pdebug("Header -> tok_smalltalk_category tok_st_identifier");
if (g_parse_mode == PROGRAM) {
- g_program->set_smalltalk_category($2);
+ g_program->set_namespace("smalltalk.category", $2);
}
}
+/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
| tok_smalltalk_prefix tok_identifier
{
+ pwarning(1, "'smalltalk_prefix' is deprecated. Use 'namespace smalltalk.prefix' instead");
pdebug("Header -> tok_smalltalk_prefix tok_identifier");
if (g_parse_mode == PROGRAM) {
- g_program->set_smalltalk_prefix($2);
+ g_program->set_namespace("smalltalk.prefix", $2);
}
}
/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */