Make the Perl generator use non-hardcoded namespaces.
- Make the Perl generator use program->get_namespace("perl")
instead of program->get_perl_package()
- Eliminate the explicit "perl_package" in t_program.
- Deprecate the perl_package token.
- Update example .thrift files and syntax files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665624 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index d555f53..654c85a 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -286,11 +286,13 @@
g_program->set_namespace("py", $2);
}
}
+/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
| tok_perl_package tok_identifier
{
+ pwarning(1, "'perl_package' is deprecated. Use 'namespace perl' instead");
pdebug("Header -> tok_perl_namespace tok_identifier");
if (g_parse_mode == PROGRAM) {
- g_program->set_perl_package($2);
+ g_program->set_namespace("perl", $2);
}
}
/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */