From e5c6400f75029124474ee989388bf2c0abdc7e0a Mon Sep 17 00:00:00 2001
From: David Li
Date: Sun, 5 Nov 2017 21:12:44 -0500
Subject: Parse type and variable declarations
---
src/semantic/translate.rs | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
(limited to 'src/semantic')
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 {
- 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::*;
--
cgit v1.2.3