diff options
author | David Li <li.davidm96@gmail.com> | 2017-11-05 21:12:44 -0500 |
---|---|---|
committer | David Li <li.davidm96@gmail.com> | 2017-11-05 21:12:44 -0500 |
commit | e5c6400f75029124474ee989388bf2c0abdc7e0a (patch) | |
tree | c713adc4c05559bb082375218a9eca9badffc531 /src/semantic | |
parent | 44570e6b300961cdcf080b82e7cc1d89fc553b0a (diff) |
Parse type and variable declarations
Diffstat (limited to 'src/semantic')
-rw-r--r-- | src/semantic/translate.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/semantic/translate.rs b/src/semantic/translate.rs index 9da6411..cf1dcf8 100644 --- a/src/semantic/translate.rs +++ b/src/semantic/translate.rs @@ -31,18 +31,19 @@ fn trans_exp<'a>(venv: &mut TypeEnvironment<'a>, exp: &WithLocation<ast::Express match &exp.value { &Let(ref decls, ref body) => { - let mut new_env = TypeEnvironment::new(None); - for decl in decls.iter() { - let decl_ty = trans_exp(venv, &*decl.value.value)?; - if let Some(_) = decl.value.type_ { - return err!(decl, TypeError::Unimplemented); - } - else { - new_env.add_binding(decl.value.name.value.clone(), decl_ty); - } - } - new_env.set_parent(venv); - trans_exp(&mut new_env, &*body) + err!(exp, TypeError::Unimplemented) + // let mut new_env = TypeEnvironment::new(None); + // for decl in decls.iter() { + // let decl_ty = trans_exp(venv, &*decl.value.value)?; + // if let Some(_) = decl.value.type_ { + // return err!(decl, TypeError::Unimplemented); + // } + // else { + // new_env.add_binding(decl.name.clone(), decl_ty); + // } + // } + // new_env.set_parent(venv); + // trans_exp(&mut new_env, &*body) }, &UnaryOp(ref op, ref operand) => { use ast::UnaryOp::*; |