starwing / lua-protobuf

A Lua module to work with Google protobuf
MIT License
1.75k stars 387 forks source link

sub.import_fallback #21

Closed chamzzzzzz closed 6 years ago

chamzzzzzz commented 6 years ago

sub.import_fallback中使用的self.unknown_import和self.import_fallback字段和文档中描述(unknown_module)不一致.

https://github.com/starwing/lua-protobuf/blob/acfaeddf6c3bdd89d1f5e69e88d415f589bb8d35/protoc.lua#L439

https://github.com/starwing/lua-protobuf/blob/acfaeddf6c3bdd89d1f5e69e88d415f589bb8d35/protoc.lua#L437

Then, you can set some options to compiler, e.g. the search path, the unknown handlers, etc. p.paths[#p.paths+1] = "whatever/folder/hold/.proto/files" p.unknown_module = function(self, module_name) ... end p.unknown_type = function(self, type_name) ... end

starwing commented 6 years ago

你往下面看,的确提到了可以用字符串和true的

chamzzzzzz commented 6 years ago
github_issue

可能我帖的代码也不是很准确,我是文档里面提到是通过 unknown_module 字段来指定fallback,但是代码中使用的是 self.import_fallback , self.unknown_import. 应该是手误。

starwing commented 6 years ago

对,的确是手误,多谢指出~