add support for embedded calls (syntax)

This commit is contained in:
Mark Thom
2017-06-25 15:39:00 -06:00
parent b349ac8bf9
commit 8a99b6d3bc
3 changed files with 1053 additions and 755 deletions

View File

@@ -20,6 +20,25 @@ BoxedTerm : Box<Term> = {
};
Call : QueryTerm = {
"call" "(" <c:Call> <ts: ("," <BoxedTerm>)*> ")" => {
match c {
QueryTerm::CallN(mut terms) => {
let vt = terms.pop().unwrap();
let mut ts = ts;
terms.append(&mut ts);
terms.push(vt);
QueryTerm::CallN(terms)
},
QueryTerm::Term(Term::Clause(cell, atom, mut terms)) => {
let mut ts = ts;
terms.append(&mut ts);
QueryTerm::Term(Term::Clause(cell, atom, terms))
},
_ => c
}
},
"call" "(" <a:Atom> "(" <ts: (<BoxedTerm> ",")*> <t:BoxedTerm> ")"
<tss: ("," <BoxedTerm>)*> ")" => {
let mut ts = ts;

File diff suppressed because it is too large Load Diff