Skip to content

Commit

Permalink
cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
mats cronqvist committed Aug 19, 2012
1 parent 44137d3 commit 4532528
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/redbug_msc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-author('Mats Cronqvist').

-export([transform/1]).
-export([unit/0,unit_quiet/0]).
-export([unit_loud/0,unit_quiet/0]).

-define(is_string(Str),
(Str=="" orelse (9=<hd(Str) andalso hd(Str)=<255))).
Expand Down Expand Up @@ -194,7 +194,8 @@ guards_fun(Str) ->
end
end.

disjunct_guard(Toks) -> %% replace ';' with 'orelse'
%% deal with disjunct guards by replacing ';' with 'orelse'
disjunct_guard(Toks) ->
[case T of {';',1} -> {'orelse',1}; _ -> T end||T<-Toks].

guard({call,1,{atom,1,G},Args}) -> {G,[arg(A) || A<-Args]}; % function
Expand Down Expand Up @@ -233,6 +234,9 @@ assert(Fun,Tag) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% ad-hoc unit testing

unit_loud() ->
lists:foreach(fun(R)->io:fwrite("~p~n",[R])end,unit()).

unit_quiet() ->
[R||R<-unit(),is_tuple(R)].

Expand All @@ -251,8 +255,6 @@ unit() ->
[{'_',[{'=/=',{element,1,'$_'},c}],[]}],[local]}}
,{"a",
{{a,'_','_'},[{'_',[],[]}],[local]}}
,{"a",
{{a,'_','_'},[{'_',[],[]}],[local]}}
,{"a->stack",
{{a,'_','_'},[{'_',[],[{message,{process_dump}}]}],[local]}}
,{"a:b",
Expand Down

0 comments on commit 4532528

Please sign in to comment.