Removed a copious amount of premature Rc-s

This commit is contained in:
2023-06-18 04:22:20 +01:00
parent aebbf51228
commit 79e28883db
56 changed files with 716 additions and 636 deletions

View File

@@ -15,20 +15,17 @@ use super::Entry;
use crate::ast::{Clause, Constant, Expr, Rule};
use crate::representations::location::Location;
use crate::representations::sourcefile::{FileEntry, Member, Namespace};
use crate::representations::VName;
fn rule_parser<'a>(
ctx: impl Context + 'a,
) -> impl SimpleParser<Entry, Rule> + 'a {
) -> impl SimpleParser<Entry, Rule<VName>> + 'a {
xpr_parser(ctx.clone())
.repeated()
.at_least(1)
.then(filter_map_lex(enum_filter!(Lexeme::Rule)))
.then(xpr_parser(ctx).repeated().at_least(1))
.map(|((p, (prio, _)), t)| Rule {
pattern: Rc::new(p),
prio,
template: Rc::new(t),
})
.map(|((p, (prio, _)), t)| Rule { pattern: p, prio, template: t })
.labelled("Rule")
}