summaryrefslogtreecommitdiff
path: root/compiler/cpp/src/thrift/generate/t_py_generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cpp/src/thrift/generate/t_py_generator.cc')
-rw-r--r--compiler/cpp/src/thrift/generate/t_py_generator.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_py_generator.cc b/compiler/cpp/src/thrift/generate/t_py_generator.cc
index 8ab8b9881..857cb77fd 100644
--- a/compiler/cpp/src/thrift/generate/t_py_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_py_generator.cc
@@ -52,7 +52,7 @@ public:
const std::map<std::string, std::string>& parsed_options,
const std::string& option_string)
: t_generator (program) {
- update_keywords();
+ update_keywords_for_validation();
std::map<std::string, std::string>::const_iterator iter;
@@ -157,6 +157,7 @@ public:
void init_generator() override;
void close_generator() override;
+ std::string display_name() const override;
/**
* Program-level generation functions
@@ -357,7 +358,7 @@ private:
std::string module_;
protected:
- std::set<std::string> lang_keywords() const override {
+ std::set<std::string> lang_keywords_for_validation() const override {
std::string keywords[] = { "False", "None", "True", "and", "as", "assert", "break", "class",
"continue", "def", "del", "elif", "else", "except", "exec", "finally", "for", "from",
"global", "if", "import", "in", "is", "lambda", "nonlocal", "not", "or", "pass", "print",
@@ -2821,6 +2822,11 @@ string t_py_generator::type_to_spec_args(t_type* ttype) {
throw "INVALID TYPE IN type_to_spec_args: " + ttype->get_name();
}
+std::string t_py_generator::display_name() const {
+ return "Python";
+}
+
+
THRIFT_REGISTER_GENERATOR(
py,
"Python",