Add generic Node type

This commit is contained in:
greg 2018-11-20 03:21:10 -08:00
parent 6be208b51d
commit 26a8ff307f

View File

@ -4,6 +4,20 @@ use std::convert::From;
use source_map::{SourceMap}; use source_map::{SourceMap};
use builtin::{BinOp, PrefixOp}; use builtin::{BinOp, PrefixOp};
pub struct Node<T> {
n: T,
meta: Meta
}
impl<T> Node<T> {
fn node(&self) -> &T {
&self.n
}
}
struct Meta {
}
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
pub struct AST(pub Vec<Statement>); pub struct AST(pub Vec<Statement>);