Skip to content
Snippets Groups Projects
Commit bc4f5e20 authored by Jasper Gräflich's avatar Jasper Gräflich
Browse files

In-progress: Switch to proper AST

parent 11f003d9
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,16 @@ mod parser;
pub use eval::eval;
/// A Node of the λ_UR AST, simplified from the UrParser.
// TODO: Switch to this vor eval
pub enum Node {
Num(u32),
Unit,
Seq(Vec<Node>),
Let{ident: String, expr: Box<Expr>},
Lookup(String),
}
// TODO: Put this elsewhere?
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum Value {
......
......@@ -12,3 +12,11 @@ pub fn tokenize(input: &str) -> Result<Pair<'_, Rule>, String> {
Err(e) => Err(format!("{e}")),
}
}
// TODO: Fill
pub fn ast(input: &str) -> Node {
match tokenize(input).as_rule() {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment