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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user