Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
5612-erl_id_trans-Handle-map-comprehensions.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5612-erl_id_trans-Handle-map-comprehensions.patch of Package erlang
From 5a01348d866e532bd94f440f4b348f92fa226c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Wed, 25 Jan 2023 15:54:04 +0100 Subject: [PATCH 12/12] erl_id_trans: Handle map comprehensions --- lib/stdlib/examples/erl_id_trans.erl | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/stdlib/examples/erl_id_trans.erl b/lib/stdlib/examples/erl_id_trans.erl index d9d1154515..792f944d36 100644 --- a/lib/stdlib/examples/erl_id_trans.erl +++ b/lib/stdlib/examples/erl_id_trans.erl @@ -409,13 +409,17 @@ expr({cons,Anno,H0,T0}) -> T1 = expr(T0), %They see the same variables {cons,Anno,H1,T1}; expr({lc,Anno,E0,Qs0}) -> - Qs1 = lc_bc_quals(Qs0), + Qs1 = comprehension_quals(Qs0), E1 = expr(E0), {lc,Anno,E1,Qs1}; expr({bc,Anno,E0,Qs0}) -> - Qs1 = lc_bc_quals(Qs0), + Qs1 = comprehension_quals(Qs0), E1 = expr(E0), {bc,Anno,E1,Qs1}; +expr({mc,Anno,E0,Qs0}) -> + Qs1 = comprehension_quals(Qs0), + E1 = expr(E0), + {mc,Anno,E1,Qs1}; expr({tuple,Anno,Es0}) -> Es1 = expr_list(Es0), {tuple,Anno,Es1}; @@ -570,21 +574,25 @@ icr_clauses([C0|Cs]) -> [C1|icr_clauses(Cs)]; icr_clauses([]) -> []. -%% -type lc_bc_quals([Qualifier]) -> [Qualifier]. +%% -type comprehension_quals([Qualifier]) -> [Qualifier]. %% Allow filters to be both guard tests and general expressions. -lc_bc_quals([{generate,Anno,P0,E0}|Qs]) -> +comprehension_quals([{generate,Anno,P0,E0}|Qs]) -> + E1 = expr(E0), + P1 = pattern(P0), + [{generate,Anno,P1,E1}|comprehension_quals(Qs)]; +comprehension_quals([{b_generate,Anno,P0,E0}|Qs]) -> E1 = expr(E0), P1 = pattern(P0), - [{generate,Anno,P1,E1}|lc_bc_quals(Qs)]; -lc_bc_quals([{b_generate,Anno,P0,E0}|Qs]) -> + [{b_generate,Anno,P1,E1}|comprehension_quals(Qs)]; +comprehension_quals([{m_generate,Anno,P0,E0}|Qs]) -> E1 = expr(E0), P1 = pattern(P0), - [{b_generate,Anno,P1,E1}|lc_bc_quals(Qs)]; -lc_bc_quals([E0|Qs]) -> + [{m_generate,Anno,P1,E1}|comprehension_quals(Qs)]; +comprehension_quals([E0|Qs]) -> E1 = expr(E0), - [E1|lc_bc_quals(Qs)]; -lc_bc_quals([]) -> []. + [E1|comprehension_quals(Qs)]; +comprehension_quals([]) -> []. %% -type fun_clauses([Clause]) -> [Clause]. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor