diff --git a/lib/spitfire.ex b/lib/spitfire.ex index 8c8942e..118a7d6 100644 --- a/lib/spitfire.ex +++ b/lib/spitfire.ex @@ -3804,6 +3804,10 @@ defmodule Spitfire do :eof end + defp peek_token(%{peek_token: nil}) do + :eof + end + defp peek_token(%{tokens: :eot}) do :eof end diff --git a/test/spitfire_test.exs b/test/spitfire_test.exs index a0b921d..cb6f749 100644 --- a/test/spitfire_test.exs +++ b/test/spitfire_test.exs @@ -2439,6 +2439,11 @@ defmodule SpitfireTest do ], [1]}, :ok ]}, [{[line: 1, column: 1], "missing closing brace for tuple"}]} + + code = "fn x -> %{a: {1," + + assert {:error, _ast, errors} = Spitfire.parse(code) + assert {[line: 1, column: 14], "missing closing brace for tuple"} in errors end test "missing closing map brace" do