-
Notifications
You must be signed in to change notification settings - Fork 200
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
enum directive ignored in params list #413
Comments
Ok, just for clarity, this seems to be caused not by type switching, so basically anything like that should reproduce the bug: meta:
id: params_enum
enums:
animals:
1: cat
2: dog
seq:
- id: one
type: u1
enum: animal
- id: invoke_with_param
type: with_param(one)
types:
with_param:
params:
- id: enumerated_one
type: u1
enum: animal
instances:
is_cat:
value: enumerated_one == animals::cat # would break if there's a bug |
I'd like to see enum param support as well. A workaround is to pass ints and cast the cases using |
Actually, I've just checked, support for enums in params was implemented ages ago: kaitai-io/kaitai_struct_compiler@41e9a06 I've just added test to confirm that — see ParamsEnum: http://kaitai.io/ci/ |
Have just checked on the latest ver from appveyor, doesn't work on this file: https://github.com/KOLANICH/kaitai_struct_formats/blob/mdt/scientific/nt_mdt/nt_mdt.ksy#L89 |
Thanks, caught yet another problem ;) New version should be available in ~15 minutes, please try again? |
Still fails. Could you test on the spec I have referenced? |
That exact spec you're referring to is obviously broken, at least in respect supplying "type" as enum, and then switching over it as it was an integer. Here's a slightly fixed version that I was testing upon: https://gist.github.com/GreyCat/e99663ca7cbc31300c07ddea9352677d If you're still getting an error, please state (1) which .ksy file exactly you're using, (2) what error you're getting. |
No replied for 1 month, from my perspective everything was fixed. Closing for now, please feel free to reopen if you still have repro. |
That works, thank you. |
I see this issue both on https://ide.kaitai.io/ and on https://ide.kaitai.io/devel right now. Same workaround of adding |
@trejkaz Unfortunately:
|
Hmm, so what's the path right now for getting a working IDE of some sort to work with KTS files? I had planned to some day make my hex viewer able to deal with them but it's probably a lot of work to get that up and going. |
Produces errors, such as:
(See Lobby discussion.)
The text was updated successfully, but these errors were encountered: