Skip to content

Commit

Permalink
fix(env): reset pdict after expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanberg committed Jun 14, 2024
1 parent e5111c5 commit 731bec7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/spitfire.ex
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ defmodule Spitfire do
rescue
NoFuelRemaining ->
{:error, :no_fuel_remaining}
after
Process.delete(:comma_list_parsers)
end

def parse!(code, opts \\ []) do
Expand Down Expand Up @@ -1379,6 +1381,8 @@ defmodule Spitfire do
aliases = [alias | aliases]

{{:__aliases__, [{:last, Process.get(:alias_last_meta)} | meta], aliases}, parser}
after
Process.delete(:alias_last_meta)
end

defp parse_bitstring(%{current_token: {:"<<", _}} = parser) do
Expand Down
2 changes: 2 additions & 0 deletions lib/spitfire/env.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ defmodule Spitfire.Env do
)

{ast, state, env, cursor_env}
after
Process.delete(:cursor_env)
end

defp expand({:__cursor__, _meta, _} = node, state, env) do
Expand Down

0 comments on commit 731bec7

Please sign in to comment.