Base compilation of some kind of file to a list of instructions seems to work(!)

I'm able to compile some basic expressions into instructions using the
`not` binary. Big first step, now we need to introduce branches and
loops to the syntax.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-09-16 18:01:40 -07:00
parent 61ac00ae39
commit e72cbe2b8c
5 changed files with 47 additions and 19 deletions

View File

@@ -2,10 +2,7 @@ use crate::syn::visit::*;
// TODO : add locations to parsed items
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Body {
pub body: Vec<Stmt>,
}
pub type Body = Vec<Stmt>;
//
// impl Accept for Body
@@ -18,8 +15,7 @@ impl<V: Visit> Accept<V> for Body {
impl<V: Visit<Out=()>> DefaultAccept<V> for Body {
fn default_accept(&self, visitor: &mut V) -> V::Out {
self.body
.iter()
self.iter()
.for_each(|stmt| visitor.visit_stmt(stmt));
}
}