fix: capture variables are a bit different
This commit is contained in:
parent
cba7a6f46e
commit
4cad053e15
|
@ -241,7 +241,7 @@ pub struct CallArg<A> {
|
||||||
impl CallArg<UntypedExpr> {
|
impl CallArg<UntypedExpr> {
|
||||||
pub fn is_capture_hole(&self) -> bool {
|
pub fn is_capture_hole(&self) -> bool {
|
||||||
match &self.value {
|
match &self.value {
|
||||||
UntypedExpr::Var { ref name, .. } => name == CAPTURE_VARIABLE,
|
UntypedExpr::Var { ref name, .. } => name.contains(CAPTURE_VARIABLE),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -608,7 +608,7 @@ impl<'comments> Formatter<'comments> {
|
||||||
|
|
||||||
UntypedExpr::Sequence { expressions, .. } => self.sequence(expressions),
|
UntypedExpr::Sequence { expressions, .. } => self.sequence(expressions),
|
||||||
|
|
||||||
UntypedExpr::Var { name, .. } if name == CAPTURE_VARIABLE => "_".to_doc(),
|
UntypedExpr::Var { name, .. } if name.contains(CAPTURE_VARIABLE) => "_".to_doc(),
|
||||||
|
|
||||||
UntypedExpr::Var { name, .. } => name.to_doc(),
|
UntypedExpr::Var { name, .. } => name.to_doc(),
|
||||||
|
|
||||||
|
@ -860,7 +860,7 @@ impl<'comments> Formatter<'comments> {
|
||||||
Some(CallArg {
|
Some(CallArg {
|
||||||
value: UntypedExpr::Var { name, .. },
|
value: UntypedExpr::Var { name, .. },
|
||||||
..
|
..
|
||||||
}) if name == CAPTURE_VARIABLE
|
}) if name.contains(CAPTURE_VARIABLE)
|
||||||
);
|
);
|
||||||
|
|
||||||
if hole_in_first_position && args.len() == 1 {
|
if hole_in_first_position && args.len() == 1 {
|
||||||
|
|
Loading…
Reference in New Issue