let z_bot = pe.z_bot;
let zrange = wasm_bindgen.range(z_bot, z_top, pe.content.length);
console.log('LOQER PLAN PE',
- pe, z_bot, z_top, pe.content.length, zrange);
+ pe, z_bot, z_top, pe.content.length, zrange.debug());
for (const e of pe.content) {
let z = zrange.next();
api_piece(api, "setz", e.piece, e.p, { z });
};
packed.to_string().into()
}
+ pub fn debug(&self) -> JsValue {
+ format!("ZCoordIterator({:?})", &self.0).into()
+ }
}
#[wasm_bindgen]
pub struct Sealed(());
+#[derive(Debug)]
pub struct Increment;
impl AddSubOffset for Increment {
fn init_delta(&self) -> LimbVal { DELTA }
const SEALED_TRAIT : Sealed = Sealed(());
}
+#[derive(Debug)]
pub struct Decrement;
impl AddSubOffset for Decrement {
fn init_delta(&self) -> LimbVal { -DELTA }
pub type RangeIterator = std::iter::Take<IteratorCore<AddSubRangeDelta>>;
+#[derive(Debug)]
pub struct IteratorCore<ASO> {
current: Mutable,
aso: ASO,
}
+#[derive(Debug)]
pub struct AddSubRangeDelta {
i: usize,
step: LimbVal,
fn len(&self) -> usize { return usize::MAX }
}
-pub type BoxedIterator = Box<dyn Iterator<Item=ZCoord>>;
+pub trait BoxedIteratorTrait : Iterator<Item=ZCoord> + Debug { }
+pub type BoxedIterator = Box<dyn BoxedIteratorTrait>;
+impl<T> BoxedIteratorTrait for T where T : Iterator<Item=ZCoord> + Debug { }
impl Mutable {
pub fn iter<ASO:AddSubOffset>(self, aso: ASO) -> IteratorCore<ASO> {
#[throws(LogicError)]
pub fn some_range(a: Option<&Mutable>, b: Option<&Mutable>,
count: RangeCount) -> BoxedIterator {
- fn mk<T:'static + Iterator<Item=ZCoord>>(x: T) -> BoxedIterator
+ fn mk<T:'static + Debug + Iterator<Item=ZCoord>>(x: T) -> BoxedIterator
{ Box::new(x) }
match (a, b) {
(None, None ) => throw!(TotallyUnboundedRange),