diff options
author | Marcus Arendt <[email protected]> | 2014-05-14 15:19:38 +0200 |
---|---|---|
committer | Marcus Arendt <[email protected]> | 2014-05-14 15:19:38 +0200 |
commit | 557ac6b188521182889a6687918ca85929fd883b (patch) | |
tree | 1cffda17028a9efcc6bf499be38e2f4b5dbc64af /lib/stdlib/src/erl_parse.yrl | |
parent | a21e69bc29d913a4f2d63abe1550a9ce97579e72 (diff) | |
parent | 5ade234d37600ea80dbb309f431c615937ea253d (diff) | |
download | otp-557ac6b188521182889a6687918ca85929fd883b.tar.gz otp-557ac6b188521182889a6687918ca85929fd883b.tar.bz2 otp-557ac6b188521182889a6687918ca85929fd883b.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/stdlib/src/erl_parse.yrl')
-rw-r--r-- | lib/stdlib/src/erl_parse.yrl | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl index 828870d492..a626d98ee4 100644 --- a/lib/stdlib/src/erl_parse.yrl +++ b/lib/stdlib/src/erl_parse.yrl @@ -860,10 +860,12 @@ build_fun(Line, Cs) -> end. check_clauses(Cs, Name, Arity) -> - mapl(fun ({clause,L,N,As,G,B}) when N =:= Name, length(As) =:= Arity -> - {clause,L,As,G,B}; - ({clause,L,_N,_As,_G,_B}) -> - ret_err(L, "head mismatch") end, Cs). + [case C of + {clause,L,N,As,G,B} when N =:= Name, length(As) =:= Arity -> + {clause,L,As,G,B}; + {clause,L,_N,_As,_G,_B} -> + ret_err(L, "head mismatch") + end || C <- Cs]. build_try(L,Es,Scs,{Ccs,As}) -> {'try',L,Es,Scs,Ccs,As}. @@ -873,17 +875,6 @@ ret_err(L, S) -> {location,Location} = get_attribute(L, location), return_error(Location, S). -%% mapl(F,List) -%% an alternative map which always maps from left to right -%% and makes it possible to interrupt the mapping with throw on -%% the first occurence from left as expected. -%% can be removed when the jam machine (and all other machines) -%% uses the standardized (Erlang 5.0) evaluation order (from left to right) -mapl(F, [H|T]) -> - V = F(H), - [V | mapl(F,T)]; -mapl(_, []) -> - []. %% Convert between the abstract form of a term and a term. |