streamline code generation with iterators and traits
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use std::cell::{Cell};
|
||||
use l0::ast::{Atom, Term, TopLevel, Var};
|
||||
|
||||
grammar;
|
||||
@@ -23,8 +24,8 @@ Term : Term = {
|
||||
<a:Atom> "(" <ts: (<BoxedTerm> ",")*> <t:BoxedTerm> ")" => {
|
||||
let mut ts = ts;
|
||||
ts.push(t);
|
||||
Term::Clause(a, ts)
|
||||
Term::Clause(Cell::new(0), a, ts)
|
||||
},
|
||||
<Atom> => Term::Atom(<>),
|
||||
<Var> => Term::Var(<>),
|
||||
<Atom> => Term::Atom(Cell::new(0), <>),
|
||||
<Var> => Term::Var(Cell::new(0), <>),
|
||||
};
|
||||
Reference in New Issue
Block a user