We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Term::children and this family of function is not returning the next term in the case of a Term::Def.
This is how it's currently defined
pub fn children(&self) -> impl DoubleEndedIterator<Item = &Term> + Clone { multi_iterator!(ChildrenIter { Zero, One, Two, Vec, Mat, Swt, Bend, Fold }); match self { Term::Mat { arg, bnd: _, with_bnd: _, with_arg, arms } => { ChildrenIter::Mat([arg.as_ref()].into_iter().chain(with_arg.iter()).chain(arms.iter().map(|r| &r.2))) } Term::Swt { arg, bnd: _, with_bnd: _, with_arg, pred: _, arms } => { ChildrenIter::Swt([arg.as_ref()].into_iter().chain(with_arg.iter()).chain(arms)) } Term::Bend { bnd: _, arg: init, cond, step, base } => { ChildrenIter::Bend(init.iter().chain([cond.as_ref(), step.as_ref(), base.as_ref()])) } Term::Fold { bnd: _, arg, with_bnd: _, with_arg, arms } => { ChildrenIter::Fold([arg.as_ref()].into_iter().chain(with_arg.iter()).chain(arms.iter().map(|r| &r.2))) } Term::Fan { els, .. } | Term::List { els } => ChildrenIter::Vec(els), Term::Let { val: fst, nxt: snd, .. } | Term::Ask { val: fst, nxt: snd, .. } | Term::Use { val: fst, nxt: snd, .. } | Term::App { fun: fst, arg: snd, .. } | Term::Oper { fst, snd, .. } => ChildrenIter::Two([fst.as_ref(), snd.as_ref()]), Term::Lam { bod, .. } | Term::With { bod, .. } | Term::Open { bod, .. } => { ChildrenIter::One([bod.as_ref()]) } Term::Var { .. } | Term::Link { .. } | Term::Num { .. } | Term::Nat { .. } | Term::Str { .. } | Term::Ref { .. } | Term::Def { .. } | Term::Era | Term::Err => ChildrenIter::Zero([]), } }
The Term::Def case should instead be Term::Def { nxt, .. } => ChildrenIter::One([nxt]).
Term::Def
Term::Def { nxt, .. } => ChildrenIter::One([nxt])
This will cause the passes to stop at local function definitions and ignore the subtrees in the AST in this csae.
This will create some bugs in the compilation, although I don't currently have any concrete example.
Bend commit 45839a7
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reproducing the behavior
Term::children and this family of function is not returning the next term in the case of a Term::Def.
This is how it's currently defined
The
Term::Def
case should instead beTerm::Def { nxt, .. } => ChildrenIter::One([nxt])
.This will cause the passes to stop at local function definitions and ignore the subtrees in the AST in this csae.
This will create some bugs in the compilation, although I don't currently have any concrete example.
System Settings
Bend commit 45839a7
Additional context
No response
The text was updated successfully, but these errors were encountered: