diff options
author | Josh Haberman <jhaberman@gmail.com> | 2016-02-02 15:18:34 -0800 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2016-02-18 10:30:21 -0800 |
commit | 55cc3aa987159bcdb491550d864115c1e8daeebb (patch) | |
tree | 0bd5a441d679ffa6b8b600a755c8284d79208b6c /src/google/protobuf/compiler/js/js_generator.h | |
parent | c40f8c1f54f028b1ca73f3fb2dfdde500f94918f (diff) |
WIP.
Diffstat (limited to 'src/google/protobuf/compiler/js/js_generator.h')
-rwxr-xr-x | src/google/protobuf/compiler/js/js_generator.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/js/js_generator.h b/src/google/protobuf/compiler/js/js_generator.h index db2dceb3..db9178d3 100755 --- a/src/google/protobuf/compiler/js/js_generator.h +++ b/src/google/protobuf/compiler/js/js_generator.h @@ -67,6 +67,13 @@ struct GeneratorOptions { bool error_on_name_conflict; // Enable binary-format support? bool binary; + // What style of imports should be used. + enum ImportStyle { + IMPORT_CLOSURE, // goog.require() + IMPORT_COMMONJS, // require() + IMPORT_BROWSER, // no import statements + IMPORT_ES6, // import { member } from '' + } import_style; GeneratorOptions() : add_require_for_enums(false), @@ -75,7 +82,8 @@ struct GeneratorOptions { namespace_prefix(""), library(""), error_on_name_conflict(false), - binary(false) {} + binary(false), + import_style(IMPORT_CLOSURE) {} bool ParseFromOptions( const vector< pair< string, string > >& options, @@ -111,6 +119,10 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator { io::Printer* printer, const vector<const FileDescriptor*>& file, std::set<string>* provided) const; + void FindProvidesForFile(const GeneratorOptions& options, + io::Printer* printer, + const FileDescriptor* file, + std::set<string>* provided) const; void FindProvidesForMessage(const GeneratorOptions& options, io::Printer* printer, const Descriptor* desc, @@ -168,6 +180,10 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator { std::set<string>* required, std::set<string>* forwards) const; + void GenerateFile(const GeneratorOptions& options, + io::Printer* printer, + const FileDescriptor* file) const; + // Generate definitions for all message classes and enums in all files, // processing the files in dependence order. void GenerateFilesInDepOrder(const GeneratorOptions& options, |