Skip to content

Formats emitted by bit_fields_* are not transparently fixed-width (e.g. for ReadArray eligibility) #327

Description

@archaephyrryx

Though all crate::helper::bit_fields_u* helper functions are fundamentally a CommonOp::EndianParse(_) wrapped in Map(_, Compute(..)), the introspection required to recognize such Formats as fixed-shape is currently missing. Rather than delve too deeply into the Format structure, it would be ideal to encode this structure at the top-level with a new StyleHint for "read a value of a given BaseKind and transform the value without any other parsing operations".

This has additional requirements for ReadArray purposes in generated code, however, as we would have to also generate the appropriate ReadUnchecked impl for each ad-hoc type corresponding to a bit_fields_u* FormatRef. At minimum, we would have to preserve sufficient details of what parse is performed, and emit some inline or standalone-fn mapping from the parsed machine-int value to the record-structure in question.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions