Skip to content

Conversation

sabiwara
Copy link
Contributor

@sabiwara sabiwara commented Oct 11, 2025

Close #14829

The problem is that do_quote(Map, Q) calls do_escape(Map, Q), and that only do_quote was supporting {:unquote, meta, [expr]} tuples.

In the second commit, I went further to split do_quote/do_escape completely, which also fixes this for remote unquote calls. We need to duplicate some of the quote/unquote handling from do_quote, although it is simpler.

do_escape({quote, Meta, Args}, #elixir_quote{unquote=true} = Q) when is_list(Meta), is_list(Args) ->
do_quote({quote, Meta, Args}, Q#elixir_quote{unquote=false});

do_escape({unquote, Meta, [Expr]}, #elixir_quote{unquote=true} = Q) when is_list(Meta) ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need unquote_splicing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so yes!
Will add it if we agree on the approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so actually it is not needed here, but when escaping lists.
Which currently works (c2aafb4), since it delegates to do_quote_tail.
But we should probably implement a do_escape_tail here too to completely separate these implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Macro.escape/2 doesn't honor :unquote option inside maps on 1.19rc

2 participants