✍️ Switch to a handwritten lexer and parser. #1
@@ -29,19 +29,13 @@ impl TypeGenerationContext {
|
|||||||
|
|
||||||
if !self.available_constructors.is_empty() {
|
if !self.available_constructors.is_empty() {
|
||||||
for name in self.available_constructors.iter() {
|
for name in self.available_constructors.iter() {
|
||||||
leaf_options.push(Type::Constructor(
|
leaf_options.push(Type::Constructor(Location::manufactured(), name.clone()));
|
||||||
Location::manufactured(),
|
|
||||||
name.clone(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.available_variables.is_empty() {
|
if !self.available_variables.is_empty() {
|
||||||
for name in self.available_variables.iter() {
|
for name in self.available_variables.iter() {
|
||||||
leaf_options.push(Type::Variable(
|
leaf_options.push(Type::Variable(Location::manufactured(), name.clone()));
|
||||||
Location::manufactured(),
|
|
||||||
name.clone(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,8 +46,7 @@ impl TypeGenerationContext {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if depth < MAXIMUM_TYPE_DEPTH && runner.rng().random_bool(0.5) {
|
if depth < MAXIMUM_TYPE_DEPTH && runner.rng().random_bool(0.5) {}
|
||||||
}
|
|
||||||
|
|
||||||
let index = runner.rng().random_range(0..leaf_options.len());
|
let index = runner.rng().random_range(0..leaf_options.len());
|
||||||
leaf_options.remove(index)
|
leaf_options.remove(index)
|
||||||
|
|||||||
Reference in New Issue
Block a user