FlatBuffersSwift
FlatBuffersSwift copied to clipboard
support compile fbs with include statement?
eg. B.fbs ... some definations ... A.fbs include "B.fbs" ... other definations ...
how about add a "-I" option to cmd line?
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.