basic support for structures through the IR
This commit is contained in:
@@ -9,6 +9,7 @@ use proptest::test_runner::{TestRng, TestRunner};
|
||||
use rand::distributions::{Distribution, WeightedIndex};
|
||||
use rand::seq::SliceRandom;
|
||||
use rand::Rng;
|
||||
use std::collections::HashMap;
|
||||
use std::str::FromStr;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
@@ -214,7 +215,10 @@ impl ProgramTree {
|
||||
}
|
||||
}
|
||||
|
||||
let current = Program { items };
|
||||
let current = Program {
|
||||
items,
|
||||
type_definitions: HashMap::new(),
|
||||
};
|
||||
|
||||
ProgramTree { _rng: rng, current }
|
||||
}
|
||||
@@ -328,6 +332,7 @@ fn generate_random_expression(
|
||||
.expect("actually chose type");
|
||||
Expression::Cast(Location::manufactured(), Type::Primitive(*to_type), inner)
|
||||
}
|
||||
Type::Structure(_) => unimplemented!(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,6 +355,7 @@ fn generate_random_expression(
|
||||
Expression::Primitive(Location::manufactured(), out_type, primop, args)
|
||||
}
|
||||
},
|
||||
Type::Structure(_) => unimplemented!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user