fixed dependency numbering error

This commit is contained in:
Louis Heredero 2024-05-19 13:27:52 +02:00
parent 1af6d4d23c
commit 83d7a8d85b
Signed by: HEL
GPG Key ID: 8D83DE470F8544E7
2 changed files with 11 additions and 8 deletions

Binary file not shown.

View File

@ -1,4 +1,4 @@
#import "range.typ"
#import "range.typ" as rng
#import "util.typ"
#let make(
@ -20,30 +20,33 @@
let ranges = (:)
for (range-span, range-data) in data.ranges {
let (start, end) = range.parse-span(str(range-span))
let (start, end) = rng.parse-span(str(range-span))
ranges.insert(
range.key(start, end),
range.load(start, end, range-data)
rng.key(start, end),
rng.load(start, end, range-data)
)
}
for range_ in ranges.values() {
let ranges2 = (:)
for (k, range_) in ranges {
if range_.values != none and range_.depends-on != none {
let depends-key = range.key(..range_.depends-on)
let depends-key = rng.key(..range_.depends-on)
let depends-range = ranges.at(depends-key)
let bits = range.bits(depends-range)
let bits = rng.bits(depends-range)
let values = (:)
for (v, d) in range_.values {
v = util.z-fill(str(int(v)), bits)
values.insert(v, d)
}
range_.values = values
}
ranges2.insert(k, range_)
}
return make(
id,
int(data.bits),
ranges,
ranges2,
start: data.at("start", default: 0)
)
}