kaitai_struct
kaitai_struct copied to clipboard
support for .to_s function to convert interger to string
using example from bcd.ksy (renamed to join it in this issue)
produce good code in ruby but in GO can't have result, only error message : "an implementation is missing"
Current golang support status can be observed here: https://ci.kaitai.io/ As you can see, it's nowhere close to 100%.
Please consider contributing fixes to make it better supported ;)
Hooking into this question, I have a larger file I am trying to compile to go, is there any way to have a more specific error on what feature is missing ?
File: https://github.com/Deep-Symmetry/crate-digger/blob/main/src/main/kaitai/rekordbox_anlz.ksy
@s00500:
Hooking into this question, I have a larger file I am trying to compile to go, is there any way to have a more specific error on what feature is missing ?
Try the --ksc-exceptions CLI option - it will give you a stack trace:
$ kaitai-struct-compiler --help
...
--ksc-exceptions ksc throws exceptions instead of human-readable error messages
@s00500 The problematic part is here - rekordbox_anlz.ksy:424-430:
mask:
value: |
[
(0xCB+c).as<s1>, (0xE1+c).as<s1>, (0xEE+c).as<s1>, (0xFA+c).as<s1>, (0xE5+c).as<s1>, (0xEE+c).as<s1>, (0xAD+c).as<s1>, (0xEE+c).as<s1>,
(0xE9+c).as<s1>, (0xD2+c).as<s1>, (0xE9+c).as<s1>, (0xEB+c).as<s1>, (0xE1+c).as<s1>, (0xE9+c).as<s1>, (0xF3+c).as<s1>, (0xE8+c).as<s1>,
(0xE9+c).as<s1>, (0xF4+c).as<s1>, (0xE1+c).as<s1>
].as<bytes>
Type casting (.as<>) is not yet implemented for Go, see https://github.com/kaitai-io/kaitai_struct/issues/931.
Hey @generalmimon Thanks a lot, that was very helpful!
Do you have any pointers to what would need to be done to add this feature? Should I start looking into the compiler or the runtime part or is there any other tipps to where to start contributions?
Greetings