Skip to content

Commit

Permalink
all unary operators are implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGlitchbyte committed Feb 2, 2024
1 parent f83590e commit 12d2e86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ocaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl OCaml {
let syntax = syn::parse_file(&src)
.map_err(|e| OCamlError::Parse(format!("'{}': {}", file_path, e)))?;

println!("{:#?}", syntax);
//println!("{:#?}", syntax);

let syntax_items: Vec<Self> = syntax.items.iter().map(|item| item.into()).collect();

Expand Down Expand Up @@ -245,9 +245,9 @@ impl From<&syn::LitFloat> for OCamlLiteral {
impl From<&syn::ExprUnary> for OCamlUnary {
fn from(value: &syn::ExprUnary) -> Self {
match value.op {
syn::UnOp::Deref(_) => todo!(),
syn::UnOp::Not(_) => todo!(),
syn::UnOp::Neg(minus, ..) => OCamlUnary::Minus(value.expr.as_ref().into()),
syn::UnOp::Deref(_) => OCamlUnary::Deref(value.expr.as_ref().into()),
syn::UnOp::Not(_) => OCamlUnary::Not(value.expr.as_ref().into()),
syn::UnOp::Neg(_) => OCamlUnary::Minus(value.expr.as_ref().into()),
_ => todo!(),
}
}
Expand Down

0 comments on commit 12d2e86

Please sign in to comment.