- Make the Ruby generator use program->get_namespace("ruby")
instead of program->get_ruby_namespace()
- Eliminate the explicit "ruby_namespace" in t_program.
- Deprecate the ruby_namespace token.
- Update example .thrift files and syntax files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665620
13f79535-47bb-0310-9956-
ffa450edef68
std::vector<std::string> ruby_modules(t_program* p) {
- std::string ns = p->get_ruby_namespace();
+ std::string ns = p->get_namespace("rb");
boost::tokenizer<> tok(ns);
std::vector<std::string> modules;
return xsd_namespace_;
}
- void set_ruby_namespace(std::string ruby_namespace) {
- ruby_namespace_ = ruby_namespace;
- }
-
- const std::string& get_ruby_namespace() const {
- return ruby_namespace_;
- }
-
void set_perl_package(std::string perl_package) {
perl_package_ = perl_package;
}
// XSD namespace
std::string xsd_namespace_;
- // Ruby namespace
- std::string ruby_namespace_;
-
// Perl namespace
std::string perl_package_;
g_program->set_perl_package($2);
}
}
+/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
| tok_ruby_namespace tok_identifier
{
+ pwarning(1, "'ruby_namespace' is deprecated. Use 'namespace rb' instead");
pdebug("Header -> tok_ruby_namespace tok_identifier");
if (g_parse_mode == PROGRAM) {
- g_program->set_ruby_namespace($2);
+ g_program->set_namespace("rb", $2);
}
}
/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
namespace java thrift.test
namespace cpp thrift.test
-ruby_namespace Thrift.Test
+namespace rb Thrift.Test
perl_package ThriftTest
namespace csharp Thrift.Test
(defconst thrift-font-lock-keywords
(list
'("#.*$" . font-lock-comment-face) ;; perl style comments
- '("\\<\\(include\\|struct\\|exception\\|typedef\\|php_namespace\\|ruby_namespace\\|perl_package\\|const\\|enum\\|service\\|extends\\|void\\|async\\|throws\\|optional\\|required\\)\\>" . font-lock-keyword-face) ;; keywords
+ '("\\<\\(include\\|struct\\|exception\\|typedef\\|php_namespace\\|perl_package\\|const\\|enum\\|service\\|extends\\|void\\|async\\|throws\\|optional\\|required\\)\\>" . font-lock-keyword-face) ;; keywords
'("\\<\\(bool\\|byte\\|i16\\|i32\\|i64\\|double\\|string\\|binary\\|map\\|list\\|set\\)\\>" . font-lock-type-face) ;; built-in types
'("\\<\\([0-9]+\\)\\>" . font-lock-variable-name-face) ;; ordinals
'("\\<\\(\\w+\\)\\s-*(" (1 font-lock-function-name-face)) ;; functions
" Keywords
syn keyword thriftKeyword namespace
-syn keyword thriftKeyword php_namespace ruby_namespace perl_package
+syn keyword thriftKeyword php_namespace perl_package
syn keyword thriftKeyword xsd_all xsd_optional xsd_nillable xsd_namespace xsd_attrs
syn keyword thriftKeyword include cpp_include cpp_type const optional required
syn keyword thriftBasicTypes void bool byte i16 i32 i64 double string binary