# HG changeset patch # User Simon Heath # Date 1583187940 18000 # Mon Mar 02 17:25:40 2020 -0500 # Node ID 3fa34665819796d89b6a94d42fe52f5bb9303ee9 # Parent 3314f03cce6e8a5618e8ed3d4b275296dad6db3d Excise hardcoded Vec4F ...unit tests need some work diff --git a/src/compile/mod.rs b/src/compile/mod.rs --- a/src/compile/mod.rs +++ b/src/compile/mod.rs @@ -74,7 +74,6 @@ // unit testing easier. use verify::TypeDef; s.add_type(&TypeDef::F32); - s.add_type(&TypeDef::Vec4F); s.add_type(&TypeDef::VecN(2)); s.add_type(&TypeDef::VecN(3)); s.add_type(&TypeDef::VecN(4)); @@ -237,17 +236,6 @@ .entry(typedef.clone()) .or_insert_with(|| b.type_float(32)) } - TypeDef::Vec4F => { - if let Some(val) = self.typetable.get(typedef) { - // Vec4F already exists - *val - } else { - let f_type_word = self.add_type(&verify::TypeDef::F32); - let vec_type_word = self.b.type_vector(f_type_word, 4); - self.typetable.insert(typedef.clone(), vec_type_word); - vec_type_word - } - } TypeDef::VecN(n) => { assert!(*n <= 4, "Vector of length {}, really? Try <= 4", n); if let Some(val) = self.typetable.get(typedef) { diff --git a/src/verify.rs b/src/verify.rs --- a/src/verify.rs +++ b/src/verify.rs @@ -74,7 +74,6 @@ #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum TypeDef { F32, - Vec4F, /// For now vec's only contain f32's VecN(u32), Bool, @@ -114,8 +113,10 @@ { // Default types. types.insert("F32".into(), TypeDef::F32); - types.insert("Vec4F".into(), TypeDef::Vec4F); types.insert("Bool".into(), TypeDef::Bool); + types.insert("Vec2".into(), TypeDef::VecN(2)); + types.insert("Vec3".into(), TypeDef::VecN(3)); + types.insert("Vec4".into(), TypeDef::VecN(4)); types.insert("()".into(), TypeDef::Unit); types.insert( "Struct4F".into(),