Compare commits

..

No commits in common. "a60d35c0b007434dcfd043e6fa2bc5ee45132345" and "469ce3ce77c5dbf1e48ed264ebbdf4a5cbd19835" have entirely different histories.

7 changed files with 8 additions and 21 deletions

4
Cargo.lock generated
View File

@ -78,7 +78,7 @@ checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
[[package]] [[package]]
name = "reid" name = "reid"
version = "1.0.0-beta.2" version = "1.0.0-beta.1"
dependencies = [ dependencies = [
"colored", "colored",
"reid-lib", "reid-lib",
@ -87,7 +87,7 @@ dependencies = [
[[package]] [[package]]
name = "reid-lib" name = "reid-lib"
version = "1.0.0-beta.2" version = "1.0.0-beta.1"
dependencies = [ dependencies = [
"llvm-sys", "llvm-sys",
"thiserror", "thiserror",

View File

@ -74,7 +74,7 @@ Big features that I want later but are not necessary:
Smaller features: Smaller features:
- ~~Hex-numbers~~ - ~~Hex-numbers~~
- ~~Bitwise operations~~ - Bitwise operations
- ~~Easier way to initialize arrays with a single value~~ - ~~Easier way to initialize arrays with a single value~~
- ~~Void-returns (`return;` for void-returning functions)~~ - ~~Void-returns (`return;` for void-returning functions)~~
- ~~Only include standard library at all if it is imported~~ - ~~Only include standard library at all if it is imported~~

View File

@ -1,6 +1,6 @@
[package] [package]
name = "reid-lib" name = "reid-lib"
version = "1.0.0-beta.2" version = "1.0.0-beta.1"
edition = "2024" edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -1,6 +1,6 @@
[package] [package]
name = "reid" name = "reid"
version = "1.0.0-beta.2" version = "1.0.0-beta.1"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -415,7 +415,6 @@ impl Expression {
// First find unfiltered parameters to binop // First find unfiltered parameters to binop
let lhs_res = lhs.typecheck(state, &typerefs, HintKind::None); let lhs_res = lhs.typecheck(state, &typerefs, HintKind::None);
let rhs_res = rhs.typecheck(state, &typerefs, HintKind::None); let rhs_res = rhs.typecheck(state, &typerefs, HintKind::None);
dbg!(&lhs_res, &rhs_res, &ret_ty);
let lhs_type = state.or_else(lhs_res, TypeKind::Vague(Vague::Unknown), lhs.1); let lhs_type = state.or_else(lhs_res, TypeKind::Vague(Vague::Unknown), lhs.1);
let rhs_type = state.or_else(rhs_res, TypeKind::Vague(Vague::Unknown), rhs.1); let rhs_type = state.or_else(rhs_res, TypeKind::Vague(Vague::Unknown), rhs.1);
@ -432,8 +431,6 @@ impl Expression {
params: (lhs_type.clone(), rhs_type.clone()), params: (lhs_type.clone(), rhs_type.clone()),
operator: *op, operator: *op,
}); });
dbg!(&binops);
// dbg!(&lhs_type, &rhs_type, &binops, &ret_ty, &expected_return_ty); // dbg!(&lhs_type, &rhs_type, &binops, &ret_ty, &expected_return_ty);
if let Some(binop) = binops if let Some(binop) = binops
.iter() .iter()

View File

@ -285,8 +285,8 @@ impl Block {
let rhs_ref = state.ok(rhs_infer, rhs.1); let rhs_ref = state.ok(rhs_infer, rhs.1);
// Try to narrow the lhs with rhs // Try to narrow the lhs with rhs
if let (Some(mut lhs_ref), Some(mut rhs_ref)) = (lhs_ref, rhs_ref) { if let (Some(mut lhs_ref), Some(rhs_ref)) = (lhs_ref, rhs_ref) {
rhs_ref.narrow(&lhs_ref); lhs_ref.narrow(&rhs_ref);
} }
} }
StmtKind::Import(_) => panic!(), StmtKind::Import(_) => panic!(),

View File

@ -356,12 +356,6 @@ impl<'outer> ScopeTypeRefs<'outer> {
rhs_ref.narrow(&self.from_type(&rhs_widened).unwrap()); rhs_ref.narrow(&self.from_type(&rhs_widened).unwrap());
} }
} }
(TypeRefKind::BinOp(_, lhs1, rhs1), TypeRefKind::BinOp(_, lhs2, rhs2)) => {
let mut lhs_ref = self.from_type(&lhs1).unwrap();
let mut rhs_ref = self.from_type(&rhs1).unwrap();
lhs_ref.narrow(&self.from_type(&lhs2).unwrap());
rhs_ref.narrow(&self.from_type(&rhs2).unwrap());
}
_ => {} _ => {}
} }
@ -372,11 +366,7 @@ impl<'outer> ScopeTypeRefs<'outer> {
*idx.borrow_mut() = *hint1.0.borrow(); *idx.borrow_mut() = *hint1.0.borrow();
} }
} }
(TypeRefKind::Direct(_), TypeRefKind::BinOp(..)) => { (TypeRefKind::Direct(_), TypeRefKind::BinOp(..)) => {}
if *idx == hint1.0 && idx != &hint2.0 {
*idx.borrow_mut() = *hint2.0.borrow();
}
}
(TypeRefKind::BinOp(..), TypeRefKind::Direct(..)) => { (TypeRefKind::BinOp(..), TypeRefKind::Direct(..)) => {
// TODO may not be good ? // TODO may not be good ?
// if *idx == hint2.0 && idx != &hint1.0 { // if *idx == hint2.0 && idx != &hint1.0 {