-
Notifications
You must be signed in to change notification settings - Fork 15
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
Multi file support + Dependency graph ordering #103
Conversation
For generating larger projects it may be desirable to generate into different files. Now --input can take a directory. If it is given a directory it will read all .cddl files and generate each in its own .rs file for export. Serialization/*Encodings are still all in one file.
cddl doesn't support parsing incomplete cddl strings so will error on some inputs. This works around it by merging it into 1 file with scope markers then using those instead to mark scope.
I'll combine the dep graph stuff into this if we can't get this merged before that is completed (likely today, or if not, tomorrow). They're both kind of related anyway, since for large |
// This approeach was chosen over comments as those were finicky when not attached | ||
// to specific structs, and the existing comment parsing ast was not suited for this. | ||
// If, in the future, cddl released a feature flag to allow partial cddl we can just | ||
// remove all this and revert back the commit before this one for scope handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me
Fixes #93 This is extra important with multi file support now, as it can be impossible in some cases to order things properly when the circular dependencies were across multiple files. Now `babbage.cddl` processes totally fine even when separated across many files. This commit also includes some fixes for multi file support with inter-file dependencies (e.g. fixes for visibility/module use/etc).
For generating larger projects it may be desirable to generate into different files. Now --input can take a directory. If it is given a directory it will read all .cddl files and generate each in its own .rs file for export. Serialization/*Encodings are still all in one file. This resolves #95
Also includes dependency graph ordering that fixes #93 and is essential for multi file support where the cyclic references are across file boundaries. This should also fix #98