basic support for structures through the IR

This commit is contained in:
2024-03-16 16:41:23 -07:00
parent b0cc2fc26b
commit a7b85d37da
12 changed files with 572 additions and 94 deletions

View File

@@ -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!(),
}
}