Converted Interner to work with Rc-s

- Interner no longer contains unsafe code
- Tokens now hold a reference to the value they represent directly

This will enable many future improvements
This commit is contained in:
2023-08-19 14:03:05 +01:00
parent ab0b57b1b8
commit 0b887ced70
62 changed files with 592 additions and 762 deletions

View File

@@ -40,7 +40,8 @@ fn collect_paths_cls_rec(
pub fn clause(cls: &postmacro::Clause) -> interpreted::Clause {
match cls {
postmacro::Clause::Constant(name) => interpreted::Clause::Constant(*name),
postmacro::Clause::Constant(name) =>
interpreted::Clause::Constant(name.clone()),
postmacro::Clause::P(p) => interpreted::Clause::P(p.clone()),
postmacro::Clause::Apply(f, x) =>
interpreted::Clause::Apply { f: expr(f.as_ref()), x: expr(x.as_ref()) },