-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New multifile export format Assuming input directory contains: `lib.cddl`, `foo.cddl`, `bar.cddl`: Old: ``` lib.rs foo.rs bar.rs cbor_encodings.rs (for entire lib) serialiation.rs (for entire lib) ``` New: ``` lib.rs cbor_encodings.rs (for stuff in lib.rs only) serialization.rs (for stuff in lib.rs only) foo/mod.rs (old foo.rs) foo/cbor_encodings.rs (for stuff in foo/mod.rs only) foo/serialization.rs (for stuff in foo/mod.rs only) bar/mod.rs bar/cbor_encodings/rs bar/serialization.rs ``` This change should help with organization, especially for users who intend to put in hand-written code wrappers around the generated code but want to do so in separate files e.g. `foo/utils.rs` for `foo` wrappers and `bar/utils.rs`. This should also make it easier to see changes in generation or do smaller generations as there is no longer some 10k line serialization.rs containing the entire babbage.cddl spec for example. An extra test was added to test multi-file support with and without preserve-encodings=true, etc as that can change which imports are included. GenerationScope::generate() / export() were also cleaned up to cleanly separate imports/etc in one spot as well as remove any sort of mutability in export(), so export() only exports (no extra raw()/push_import() calls - all of this is done at the end of generate() now).
- Loading branch information
1 parent
3309684
commit d8554ce
Showing
15 changed files
with
348 additions
and
267 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters