Skip to content

Commit

Permalink
Make todos more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
voltrevo committed Jun 28, 2023
1 parent b798304 commit 4642f22
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
48 changes: 24 additions & 24 deletions valuescript_compiler/src/scope_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,50 +1099,50 @@ impl ScopeAnalysis {
Expr::SuperProp(super_prop) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: super_prop".to_string(),
span: super_prop.span,
});
}
Expr::JSXMember(_) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: jsx_member".to_string(),
span: expr.span(),
});
}
Expr::JSXNamespacedName(_) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: jsx_namespaced_name".to_string(),
span: expr.span(),
});
}
Expr::JSXEmpty(_) => {}
Expr::JSXElement(jsx_element) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: jsx_element".to_string(),
span: jsx_element.span,
});
}
Expr::JSXFragment(jsx_fragment) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: jsx_fragment".to_string(),
span: jsx_fragment.span,
});
}
Expr::TsInstantiation(ts_instantiation) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: ts_instantiation".to_string(),
span: ts_instantiation.span,
});
}
Expr::PrivateName(private_name) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: private_name".to_string(),
span: private_name.span,
});
}
Expand Down Expand Up @@ -1348,120 +1348,120 @@ impl ScopeAnalysis {
Expr::Fn(fn_) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate fn".to_string(),
span: fn_.function.span,
});
}
Expr::Unary(unary) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate unary".to_string(),
span: unary.span,
});
}
Expr::Update(update) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate update".to_string(),
span: update.span,
});
}
Expr::Bin(bin) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate binary exp".to_string(),
span: bin.span,
});
}
Expr::Assign(assign) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate assignment".to_string(),
span: assign.span,
});
}
Expr::SuperProp(super_prop) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate super_prop".to_string(),
span: super_prop.span,
});
}
Expr::Cond(cond) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate cond".to_string(),
span: cond.span,
});
}
Expr::Seq(seq) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate seq".to_string(),
span: seq.span,
});
}
Expr::Lit(_) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate lit".to_string(),
span: expr.span(),
});
}
Expr::Yield(yield_) => {
diagnostic = Some(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate yield".to_string(),
span: yield_.span,
});
}
Expr::Await(await_) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::Error,
message: "TODO".to_string(),
message: "TODO: mutate await".to_string(),
span: await_.span,
});
}
Expr::JSXMember(_) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate jsx_member".to_string(),
span: expr.span(),
});
}
Expr::JSXNamespacedName(_) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate jsx_namespaced_name".to_string(),
span: expr.span(),
});
}
Expr::JSXEmpty(_) => {}
Expr::JSXElement(jsx_element) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate jsx_element".to_string(),
span: jsx_element.span,
});
}
Expr::JSXFragment(jsx_fragment) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate jsx_fragment".to_string(),
span: jsx_fragment.span,
});
}
Expr::TsInstantiation(ts_instantiation) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate ts_instantiation".to_string(),
span: ts_instantiation.span,
});
}
Expr::PrivateName(private_name) => {
self.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
message: "TODO".to_string(),
message: "TODO: mutate private_name".to_string(),
span: private_name.span,
});
}
Expand Down
16 changes: 8 additions & 8 deletions valuescript_vm/src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn op_plus(left: &Val, right: &Val) -> Result<Val, Val> {
(Some(left_bigint), Some(right_bigint)) => {
return Ok(Val::BigInt(left_bigint + right_bigint));
}
_ => return Err("TODO".to_error()),
_ => return Err("TODO: plus with bigint and non-bigint".to_error()),
}
}

Expand Down Expand Up @@ -121,7 +121,7 @@ pub fn op_eq_impl(left: &Val, right: &Val) -> Result<bool, Val> {
(Val::Number(left_number), Val::Number(right_number)) => left_number == right_number,
(Val::String(left_string), Val::String(right_string)) => left_string == right_string,
(Val::BigInt(left_bigint), Val::BigInt(right_bigint)) => left_bigint == right_bigint,
_ => return Err("TODO".to_error()),
_ => return Err("TODO: op== with other types".to_error()),
})
}

Expand All @@ -145,7 +145,7 @@ pub fn op_triple_eq_impl(left: &Val, right: &Val) -> Result<bool, Val> {
if left.typeof_() != right.typeof_() {
false
} else {
return Err("TODO".to_error());
return Err("TODO: op=== with other types".to_error());
}
}
})
Expand Down Expand Up @@ -189,7 +189,7 @@ pub fn op_less(left: &Val, right: &Val) -> Result<Val, Val> {
if left.typeof_() == VsType::Undefined || right.typeof_() == VsType::Undefined {
false
} else {
return Err("TODO".to_error());
return Err("TODO: op< with other types".to_error());
}
}
}))
Expand All @@ -203,7 +203,7 @@ pub fn op_less_eq(left: &Val, right: &Val) -> Result<Val, Val> {
(Val::Number(left_number), Val::Number(right_number)) => left_number <= right_number,
(Val::String(left_string), Val::String(right_string)) => left_string <= right_string,
(Val::BigInt(left_bigint), Val::BigInt(right_bigint)) => left_bigint <= right_bigint,
_ => return Err("TODO".to_type_error()),
_ => return Err("TODO: op<= with other types".to_type_error()),
}))
}

Expand All @@ -215,7 +215,7 @@ pub fn op_greater(left: &Val, right: &Val) -> Result<Val, Val> {
(Val::Number(left_number), Val::Number(right_number)) => left_number > right_number,
(Val::String(left_string), Val::String(right_string)) => left_string > right_string,
(Val::BigInt(left_bigint), Val::BigInt(right_bigint)) => left_bigint > right_bigint,
_ => return Err("TODO".to_error()),
_ => return Err("TODO: op> with other types".to_error()),
}))
}

Expand All @@ -227,7 +227,7 @@ pub fn op_greater_eq(left: &Val, right: &Val) -> Result<Val, Val> {
(Val::Number(left_number), Val::Number(right_number)) => left_number >= right_number,
(Val::String(left_string), Val::String(right_string)) => left_string >= right_string,
(Val::BigInt(left_bigint), Val::BigInt(right_bigint)) => left_bigint >= right_bigint,
_ => return Err("TODO".to_type_error()),
_ => return Err("TODO: op>= with other types".to_type_error()),
}))
}

Expand Down Expand Up @@ -324,7 +324,7 @@ pub fn op_left_shift(left: &Val, right: &Val) -> Result<Val, Val> {
pub fn op_right_shift(left: &Val, right: &Val) -> Result<Val, Val> {
match (left.as_bigint_data(), right.as_bigint_data()) {
(Some(left_bigint), Some(right_bigint)) => {
let right_i64 = right_bigint.to_i64().ok_or("TODO".to_val())?;
let right_i64 = right_bigint.to_i64().ok_or("TODO: handle i64 conversion failure".to_val())?;
Ok(Val::BigInt(left_bigint >> right_i64))
}
(Some(_), None) | (None, Some(_)) => Err("Cannot mix BigInt with other types".to_type_error()),
Expand Down

0 comments on commit 4642f22

Please sign in to comment.