We need to rewrite trees on untyped-tree phase, because later we cannot turn Expr.quote {} into '{} etc.
But this it not aware of a context, and each code looking like Expr.quote/Expr.splice will be rewritten.
Probably something like would be needed:
- during untyped tree phase
- create rewritten tree part
- create a "tuple" of sort (rewrittenTree, originalTree)
- after/during type checking
- check if the symbols points to Cross-Quotes
- pick rewritten tree if they do, restore the original tree if they don't
We need to rewrite trees on untyped-tree phase, because later we cannot turn
Expr.quote {}into'{}etc.But this it not aware of a context, and each code looking like Expr.quote/Expr.splice will be rewritten.
Probably something like would be needed: