Skip to content

Commit

Permalink
Fixes mutual bug between rewrites & printer
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucassifoni committed Apr 24, 2024
1 parent c5b9822 commit 52513b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions ovo/lib/ovo/printer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ defmodule Ovo.Printer do
end

def print_node({:assignment, expr, sym}) do
case sym do
{_, _, {_, _, vv}} -> "#{vv} = #{print_node(expr)}"
{_, _, vv} -> "#{vv} = #{print_node(expr)}"
end
{_, _, vv} = sym
"#{vv} = #{print_node(expr)}"
end

def print_node({:shake, _, v}) do
Expand Down
6 changes: 3 additions & 3 deletions ovo/lib/ovo/rewrites.ex
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ defmodule Ovo.Rewrites do
},
maparg0,
{:list, [], nil}
],
{:symbol, [], "reduce"}
}
]
},
{:symbol, [], "reduce"},
}
| rewrite_node_list(rest)
]
Expand Down

0 comments on commit 52513b9

Please sign in to comment.