Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

XRBK macro: conditionally enable parsing based on given derive traits #50

Open
Antikyth opened this issue Jan 15, 2023 · 0 comments
Open
Labels
bug Something isn't working task An essential task for a planned milestone.

Comments

@Antikyth
Copy link
Collaborator

Antikyth commented Jan 15, 2023

There is certain macro syntax which should be parsed or not parsed depending on which XRBK traits one derives.

For example, a let element would be parsed if any of these traits are derived:

  • X11Size
  • ConstantX11Size
  • Readable

...but without the source used to write it:

let name_len: u16

Only if Writable is derived would it have a source:

let name_len: u16 = name => name.len() as u16

Also, if the macro syntax is parsed conditionally depending on which traits are derived, then all structs should be parsed custom, not just those with at least one XRBK trait. This is so that requests, replies, events, and errors may still be implemented without deriving their XRBK traits (you really should, but for consistency, and therefore each of learning, it wouldn't be required). It also means better errors can be given.

@github-project-automation github-project-automation bot moved this to Unassigned in X Rust Bindings Jan 15, 2023
@Antikyth Antikyth self-assigned this Jan 15, 2023
@Antikyth Antikyth moved this from Unassigned to Assigned in X Rust Bindings Jan 15, 2023
@Antikyth Antikyth added task An essential task for a planned milestone. bug Something isn't working labels Jan 15, 2023
@Antikyth Antikyth moved this from Assigned to Unassigned in X Rust Bindings Jan 15, 2023
@Antikyth Antikyth removed their assignment Jan 15, 2023
@Antikyth Antikyth pinned this issue Jan 15, 2023
@Antikyth Antikyth unpinned this issue Feb 3, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working task An essential task for a planned milestone.
Projects
Status: Unassigned
Development

No branches or pull requests

1 participant