Use sequenced collection for VarMap #388
No reviewers
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Depends on
#387 Add miscellaneous abstraction
M-Labs/nac3
Reference: M-Labs/nac3#388
Loading…
Reference in New Issue
No description provided.
Delete Branch "refactor/sequenced-varmap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While tackling the issue of type variables (still) not outputting according to their declared order, I realized that neither
BTreeMap
norVec
are good enough solutions.BTreeMap
sorts automatically by its key (in our case, the type variable ID). However, some type variables at the same position will be generated more than once during declaration parsing (e.g.A[typevar40, typvar37]
), therefore the order of type variables will be wrong.Vec
is a sequenced container, howeverVarMap
also wants guarantees that no two entries share the same type variable ID, as this would mean that the same type variable possesses two values at the same time.To solve this,
VarMap
is now aliased toIndexMap
, which preserves the insertion order of elements, and uses the insertion order as its default iteration order.d03ad8a1c4
to9a8342d6d4
9a8342d6d4
tod2eb9255c3
d2eb9255c3
toaa84cc425f
aa84cc425f
toba9e417967
ba9e417967
tod49f8b4a81
d49f8b4a81
toedd9832f6c
edd9832f6c
toae2c1a7ee5
ae2c1a7ee5
to13f06f3e29