From a720859eb9679b79117530507d3b29810bc669bc Mon Sep 17 00:00:00 2001 From: Thomas Timmer Date: Wed, 15 May 2024 17:08:13 +0200 Subject: [PATCH] feat: add spitfire parser --- lib/mix_edit.ex | 3 ++- mix.exs | 5 ++++- mix.lock | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/mix_edit.ex b/lib/mix_edit.ex index 314f4cb..1d36d28 100644 --- a/lib/mix_edit.ex +++ b/lib/mix_edit.ex @@ -61,7 +61,8 @@ defmodule MixEdit do emit_warnings: false ] - Code.string_to_quoted_with_comments!(intext, quote_opts) + {:ok, data, comments} = Spitfire.parse_with_comments(intext, quote_opts) + {data, comments} end @doc "Function that updates the mix.exs file (or `Mix.Project`)" diff --git a/mix.exs b/mix.exs index 2328297..3fa71cf 100644 --- a/mix.exs +++ b/mix.exs @@ -33,6 +33,9 @@ defmodule MixEdit.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do - [] + [ + {:spitfire, git: "https://github.com/elixir-tools/spitfire.git"} + # {:spitfire, path: "../spitfire"} + ] end end diff --git a/mix.lock b/mix.lock index 0ac823b..3b95a15 100644 --- a/mix.lock +++ b/mix.lock @@ -1,2 +1,3 @@ %{ + "spitfire": {:git, "https://github.com/elixir-tools/spitfire.git", "e47385f64db19f65b8efdd57d003272376446a4e", []}, }