Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding strip command

  • Loading branch information...
commit 0f9446ec23abd0eb1f5342a8cf3303015779eabb 1 parent 4603414
Jacob Vorreuter authored
Showing with 10 additions and 0 deletions.
  1. +7 −0 src/ex_eval.erl
  2. +3 −0  src/ex_pp.erl
View
7 src/ex_eval.erl
@@ -89,6 +89,13 @@ expand(State, {concat, Source}) ->
List when is_list(List) -> lists:concat(List);
_ -> {concat, Source}
end;
+
+%% Strip
+expand(State, {strip, Source}) ->
+ case expand(State, Source) of
+ List when is_list(List) -> string:strip(List);
+ _ -> {strip, Source}
+ end;
%% Length
expand(State, {length, Source}) ->
View
3  src/ex_pp.erl
@@ -235,6 +235,9 @@ expand_arg({call, _, {atom, _, last}, [Key]}) ->
expand_arg({call, _, {atom, _, concat}, [Key]}) ->
{tuple, ?L, [{atom,?L,concat}, expand_arg(Key)]};
+expand_arg({call, _, {atom, _, strip}, [Key]}) ->
+ {tuple, ?L, [{atom,?L,strip}, expand_arg(Key)]};
+
expand_arg({call, _, {atom, _, range}, [Start, End]}) ->
{tuple, ?L, [{atom,?L,range}, expand_arg(Start), expand_arg(End)]};
Please sign in to comment.
Something went wrong with that request. Please try again.