From 731bec78a3d6287e8d5146ef3175495c91d461b5 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Fri, 14 Jun 2024 07:31:54 -0400 Subject: [PATCH] fix(env): reset pdict after expansion --- lib/spitfire.ex | 4 ++++ lib/spitfire/env.ex | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/spitfire.ex b/lib/spitfire.ex index d130be4..439e925 100644 --- a/lib/spitfire.ex +++ b/lib/spitfire.ex @@ -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 @@ -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 diff --git a/lib/spitfire/env.ex b/lib/spitfire/env.ex index 75996e8..921fd14 100644 --- a/lib/spitfire/env.ex +++ b/lib/spitfire/env.ex @@ -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