master
Jordan Orelli 8 years ago
parent 5beddd91a3
commit 59949e2e80

@ -137,7 +137,7 @@ var hlist = nodeList{
panic("not implemented: PushOneLeftDeltaOneRightNonZero")
}},
lNode{"PopAllButOnePlusOne", 29, 1837, func(r *selectionReader, br bit.Reader) {
r.cur.count = 1
r.pop(-1)
r.add(1)
}},
lNode{"PlusThree", 2, 1375, func(r *selectionReader, br bit.Reader) {
@ -147,7 +147,7 @@ var hlist = nodeList{
panic("not implemented: PlusFour")
}},
lNode{"PopAllButOnePlusNPack6Bits", 32, 634, func(r *selectionReader, br bit.Reader) {
r.cur.count = 1
r.pop(-1)
r.add(int(br.ReadBits(6)) + 1)
}},
lNode{"PushOneLeftDeltaNRightZero", 9, 560, func(r *selectionReader, br bit.Reader) {
@ -174,7 +174,7 @@ var hlist = nodeList{
panic("not implemented: PushOneLeftDeltaNRightNonZeroPack8Bits")
}},
lNode{"PopAllButOnePlusN", 30, 149, func(r *selectionReader, br bit.Reader) {
r.cur.count = 1
r.pop(-1)
r.add(int(bit.ReadUBitVarFP(br)) + 1)
}},
lNode{"NonTopoComplexPack4Bits", 38, 99, func(r *selectionReader, br bit.Reader) {
@ -200,7 +200,7 @@ var hlist = nodeList{
r.push(int(bit.ReadUBitVarFP(br)))
}},
lNode{"PopOnePlusOne", 27, 2, func(r *selectionReader, br bit.Reader) {
r.pop()
r.pop(1)
r.add(1)
}},
lNode{"PopNAndNonTopographical", 35, 1, func(r *selectionReader, br bit.Reader) {

@ -32,7 +32,6 @@ func (s selection) fill(offset int, displayPath string, dest slotted, br bit.Rea
case *Entity:
Debug.Printf("%s %s (%s)", s, fmt.Sprintf("%s.%s", displayPath, dest.slotName(slot)), dest.slotType(slot))
return nil
// Info.Fatalf("%v entity has no decoder for slot %d (%v)", v.Class, slot, v.Class.Fields[slot])
default:
Info.Printf("slotted value %v has no decoder for slot %d", dest, slot)
return nil
@ -96,8 +95,15 @@ func (r *selectionReader) push(i int) {
r.cur.count++
}
// pops the last value off of the current selection
func (r *selectionReader) pop() { r.cur.count-- }
// pops n elements from the selection. if n is negative, pops all but n
// elements from the selection.
func (r *selectionReader) pop(n int) {
if n < 0 {
r.cur.count = -n
} else {
r.cur.count -= n
}
}
// maps a function over the current set of values in the current selection
func (r *selectionReader) måp(fn func(int) int) {

Loading…
Cancel
Save