cryspen/hax

Attributes: deduplicate parent attributes

Aperta

#123 aperta il 6 giu 2023

 (4 commenti) (0 reazioni) (0 assegnatari)OCaml (61 fork)auto 404
P2frontendgood first issuehelp wantedkeep-open

Metriche repository

Star
 (456 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

For now, we extract every item that lives in a crate, but not modules. Indeed, if we disregard attributes, a module is really just a group of items, so having modules as such is not useful, we can recover the module structure looking at names.

However, modules can also carry attributes, so we need a way of retrieving them. Either: - we extract mod items, consisting of a list of names plus a list of attributes; - we add a parent_attributes field on each item, but that will cause duplication of attributes.

I think having mod items is the way to go.

Because it was easier, the -ugly- second option was implemented.

Instead, I think we should extract a simple mapping from module def_ids to attributes, in addition to a list of items.

Guida contributor