-
Notifications
You must be signed in to change notification settings - Fork 48
zcbor.py: Add support for unordered maps in generated code #425
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
base: main
Are you sure you want to change the base?
zcbor.py: Add support for unordered maps in generated code #425
Conversation
10152df to
36e9986
Compare
f32fa46 to
087ba75
Compare
087ba75 to
784c7c2
Compare
40b1e6b to
60ba45c
Compare
60ba45c to
1f2aa22
Compare
|
@oyvindronningstad Any traction here? Will we get this for NCS 2.8? |
2d99eec to
0fe723f
Compare
0fe723f to
9c305b4
Compare
zcbor/zcbor.py
Outdated
| {(linesep + " ").join(((str(relativify(f)) for f in include_dirs)))} | ||
| ) | ||
| """ | ||
| {f"\n{smart_search}\n" if add_smart_search else ''}""" |
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.
Nit: The use of backslashes in the formatted string doesn't work on version 3.10 python - forced me to update python to pickup this change.
26f2074 to
6ee1278
Compare
6ee1278 to
c68b43c
Compare
d229ca7 to
712a778
Compare
|
@oyvindronningstad @darkofc It would be really great if this PR could be merged so that we can start to use this feature |
712a778 to
4d0b6ea
Compare
|
@jtguggedal I'm working on it. Sorry it's taken a long time, but each time I come back to it, I change it quite a bit, because it would be prone to bugs or user error. It contains surprisingly many tricky edge cases and tough decisions. Hoping to finish it soon. |
Good stuff, thanks for the update! |
b43d6c5 to
17e1aeb
Compare
17e1aeb to
cbe2e46
Compare
together with the zcbor state. Signed-off-by: Øyvind Rønningstad <[email protected]>
I.e. in unions and repetitions. In both cases, it's ok to fail decoding something because it's optional, and if the union element or repeated data being decoded includes multiple map elements, backups are needed in case flags have been set for some map elements, then fails later. In that case, the previous map elements' flags must be undone, and a backup is the way to keep the old state so it can be restored. Signed-off-by: Øyvind Rønningstad <[email protected]>
1d24eb4 to
dbee639
Compare
Add support for the --unordered-maps option to zcbor code which makes use of the zcbor_unordered_maps_*() API in generated code. Signed-off-by: Øyvind Rønningstad <[email protected]>
dbee639 to
aad09cf
Compare
Add support for the --unordered-maps option to zcbor code
which makes use of the zcbor_unordered_maps_*() API in generated code.
Fixes #411