Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support compile fbs with include statement? #85

Open
navigator117 opened this issue Dec 11, 2017 · 2 comments
Open

support compile fbs with include statement? #85

navigator117 opened this issue Dec 11, 2017 · 2 comments

Comments

@navigator117
Copy link

eg.
B.fbs
...
some definations
...
A.fbs
include "B.fbs"
...
other definations
...

@navigator117
Copy link
Author

how about add a "-I" option to cmd line?

@mzaks
Copy link
Owner

mzaks commented Dec 11, 2017

Hi, the semantics of the include statements are a bit more complex, because they open up many edge cases. E.g. you have A.fbs and B.fbs which both include C.fbs as C.fbs contain the basic/reusable definitions. Then if you generate A.fbs and B.fbs you would end up with double declarations in A.swift and B.swift this is where namespacing comes handy. But this feature is also not implemented as Swift does not really have namespacing, except for wrapping things in an enum.
So in order to solve it you could provide a list of definition names which should be ignored while generating. I am actually almost finished with code_gen branch (https://github.com/mzaks/FlatBuffersSwift/tree/code_gen) where the FBS parser and code generator is written in Swift. It would make sense to put flexible support for include statement there, but sadly I can't give you any time frame as I don't use FlatBuffersSwift in my current project. It's one of my side projects now, this is why the activity is not that high.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants