getting closer ...
This commit is contained in:
@@ -359,19 +359,21 @@ fn generate_random_expression(
|
||||
.iter()
|
||||
.filter_map(|(variable, ty)| {
|
||||
if ty.is_printable() {
|
||||
Some(variable.clone())
|
||||
Some((variable.clone(), ty.clone()))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<Vec<Variable>>();
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if possible_variables.is_empty() {
|
||||
generate_random_binding(rng, env)
|
||||
} else {
|
||||
let (variable, var_type) = possible_variables.choose(rng).unwrap();
|
||||
|
||||
Expression::Print(
|
||||
Location::manufactured(),
|
||||
possible_variables.choose(rng).unwrap().clone(),
|
||||
ValueOrRef::Ref(Location::manufactured(), var_type.clone(), variable.clone()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user