Skip to content

Commit

Permalink
Make term-level rewrite use bottom-up order by default; closes #3
Browse files Browse the repository at this point in the history
Bottom-up rewriting is safer (less prone to divergence) and often more
natural, so it’s a better default behavior.

Note that this is potentially a breaking change, though I expect that
most code that uses `rewrite` will still work.

Currently some tests are broken; they will be fixed in the next commit.
  • Loading branch information
LPTK committed Dec 12, 2017
1 parent 67daa65 commit 8d98f22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/squid/ir/RuleBasedTransformer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class RuleBasedTransformerMacros(val c: whitebox.Context) {

val recursive = c.macroApplication.symbol.annotations.exists(_.tree.tpe <:< typeOf[RecRewrite])
val RuleBasedTrans = if (recursive) tq"_root_.squid.ir.FixPointRuleBasedTransformer" :: tq"_root_.squid.ir.BottomUpTransformer" :: Nil
else tq"_root_.squid.ir.SimpleRuleBasedTransformer" :: tq"_root_.squid.ir.TopDownTransformer" :: Nil
else tq"_root_.squid.ir.SimpleRuleBasedTransformer" :: tq"_root_.squid.ir.BottomUpTransformer" :: Nil

//val $transName = new _root_.scp.ir.SimpleRuleBasedTransformer with _root_.scp.ir.TopDownTransformer {
//val $transName: _root_.scp.ir.Transformer{val base: ${base.tpe} } = new _root_.scp.ir.SimpleTransformer {
Expand Down

0 comments on commit 8d98f22

Please sign in to comment.