init commit

This commit is contained in:
2026-03-09 23:09:46 -04:00
parent 5cbc493cc5
commit 5da77e3360
73 changed files with 9935 additions and 103 deletions
+25
View File
@@ -100,6 +100,10 @@ defmodule CljElixir.Analyzer do
validate_loop(args, meta, ctx)
end
defp validate_form({:list, _meta, [{:symbol, _, "receive"} | args]}, ctx) do
validate_receive(args, ctx)
end
defp validate_form({:list, meta, [{:symbol, _, "recur"} | _args]}, ctx) do
validate_recur(meta, ctx)
end
@@ -529,6 +533,27 @@ defmodule CljElixir.Analyzer do
end
end
# receive propagates tail position into clause bodies
defp validate_receive(clauses, ctx) do
validate_receive_clauses(clauses, ctx)
end
defp validate_receive_clauses([], _ctx), do: []
defp validate_receive_clauses([:after, _timeout, body | rest], ctx) do
validate_form(body, ctx) ++ validate_receive_clauses(rest, ctx)
end
defp validate_receive_clauses([_pattern, :guard, _guard, body | rest], ctx) do
validate_form(body, ctx) ++ validate_receive_clauses(rest, ctx)
end
defp validate_receive_clauses([_pattern, body | rest], ctx) do
validate_form(body, ctx) ++ validate_receive_clauses(rest, ctx)
end
defp validate_receive_clauses([_], _ctx), do: []
defp validate_recur(meta, ctx) do
line = meta_line(meta)
col = meta_col(meta)