[m-rev.] diff: convert if-then-elses to switches in analysis and browser

Zoltan Somogyi zs at csse.unimelb.edu.au
Sun Dec 30 22:10:31 AEDT 2007


analysis/analysis.file.m:
analysis/analysis.m:
browser/declarative_execution.m:
browser/declarative_tree.m:
browser/declarative_user.m:
browser/interactive_query.m:
browser/parse.m:
browser/sized_pretty.m:
	Convert some if-then-elses to switches.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
Index: analysis/analysis.file.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/analysis/analysis.file.m,v
retrieving revision 1.7
diff -u -b -r1.7 analysis.file.m
--- analysis/analysis.file.m	25 Jul 2007 07:01:48 -0000	1.7
+++ analysis/analysis.file.m	27 Nov 2007 02:37:10 -0000
@@ -641,7 +641,8 @@
         io.nl(!IO)
     ), !IO),
     io.open_input(AnalysisFileName, InputResult, !IO),
-    ( InputResult = ok(InputStream) ->
+    (
+        InputResult = ok(InputStream),
         % Request file already exists.  Check it has the right version
         % number, then append the new requests to the end.
 
@@ -654,7 +655,8 @@
                 term.integer(version_number), [], _))
         ->
             io.open_append(AnalysisFileName, AppendResult, !IO),
-            ( AppendResult = ok(AppendStream) ->
+            (
+                AppendResult = ok(AppendStream),
                 io.set_output_stream(AppendStream, OldOutputStream, !IO),
                 write_analysis_entries(write_request_entry(Compiler),
                     ModuleRequests, !IO),
@@ -662,12 +664,14 @@
                 io.close_output(AppendStream, !IO),
                 Appended = yes
             ;
+                AppendResult = error(_),
                 Appended = no
             )
         ;
             Appended = no
         )
     ;
+        InputResult = error(_),
         Appended = no
     ),
     (
Index: analysis/analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/analysis/analysis.m,v
retrieving revision 1.11
diff -u -b -r1.11 analysis.m
--- analysis/analysis.m	25 Jul 2007 07:15:35 -0000	1.11
+++ analysis/analysis.m	27 Nov 2007 02:36:38 -0000
@@ -866,9 +866,12 @@
     analysis_info::in, analysis_info::out, io::di, io::uo) is det.
 
 taint_module_overall_status(Status, ModuleId, !Info, !IO) :-
-    ( Status = optimal ->
-        true
+    (
+        Status = optimal
     ;
+        ( Status = suboptimal
+        ; Status = invalid
+        ),
         ensure_old_module_analysis_results_loaded(ModuleId, !Info, !IO),
         debug_msg((pred(!.IO::di, !:IO::uo) is det :-
             io.print("Tainting the overall module status of ", !IO),
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
Index: browser/declarative_execution.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/declarative_execution.m,v
retrieving revision 1.62
diff -u -b -r1.62 declarative_execution.m
--- browser/declarative_execution.m	23 Nov 2007 07:34:51 -0000	1.62
+++ browser/declarative_execution.m	27 Nov 2007 03:00:23 -0000
@@ -591,54 +591,68 @@
 
 %-----------------------------------------------------------------------------%
 
-step_left_in_contour(Store, node_exit(_, Call, _, _, _, _, _, _)) = Prec :-
+step_left_in_contour(Store, Node) = Prec :-
+    (
+        Node = node_exit(_, Call, _, _, _, _, _, _),
     call_node_from_id(Store, Call, CallNode),
-    Prec = CallNode ^ call_preceding.
-step_left_in_contour(Store, node_excp(_, Call, _, _, _, _, _)) = Prec :-
+        Prec = CallNode ^ call_preceding
+    ;
+        Node = node_excp(_, Call, _, _, _, _, _),
     call_node_from_id(Store, Call, CallNode),
-    Prec = CallNode ^ call_preceding.
-step_left_in_contour(_, node_switch(Prec, _)) = Prec.
-step_left_in_contour(_, node_first_disj(Prec, _)) = Prec.
-step_left_in_contour(Store, node_later_disj(_, _, FirstDisj)) = Prec :-
-    first_disj_node_from_id(Store, FirstDisj, node_first_disj(Prec, _)).
-step_left_in_contour(_, node_cond(Prec, _, Status)) = Node :-
-    ( Status = failed ->
+        Prec = CallNode ^ call_preceding
+    ;
+        Node = node_switch(Prec, _)
+    ;
+        Node = node_first_disj(Prec, _)
+    ;
+        Node = node_later_disj(_, _, FirstDisj),
+        first_disj_node_from_id(Store, FirstDisj, node_first_disj(Prec, _))
+    ;
+        Node = node_cond(Prec, _, Status),
+        (
+            Status = failed,
         throw(internal_error("step_left_in_contour", "failed COND node"))
     ;
-        Node = Prec
-    ).
-step_left_in_contour(_, node_then(Prec, _, _)) = Prec.
-step_left_in_contour(Store, node_else(_, Cond, _)) = Prec :-
-    cond_node_from_id(Store, Cond, node_cond(Prec, _, _)).
-step_left_in_contour(Store, node_neg_succ(_, Neg, _)) = Prec :-
-    neg_node_from_id(Store, Neg, node_neg(Prec, _, _)).
-    %
-    % The following cases are possibly at the left end of a contour,
-    % where we cannot step any further.
-    %
-step_left_in_contour(_, node_call(_, _, _, _, _, _, _, _, _, _)) = _ :-
-    throw(internal_error("step_left_in_contour", "unexpected CALL node")).
-step_left_in_contour(_, node_neg(Prec, _, Status)) = Next :-
-    ( Status = undecided ->
+            ( Status = undecided
+            ; Status = succeeded
+            )
+        )
+    ;
+        Node = node_then(Prec, _, _)
+    ;
+        Node = node_else(_, Cond, _),
+        cond_node_from_id(Store, Cond, node_cond(Prec, _, _))
+    ;
+        Node = node_neg_succ(_, Neg, _),
+        neg_node_from_id(Store, Neg, node_neg(Prec, _, _))
+    ;
+        Node = node_call(_, _, _, _, _, _, _, _, _, _),
+        % We are at the left end of a contour, so we cannot step any further.
+        throw(internal_error("step_left_in_contour", "unexpected CALL node"))
+    ;
+        Node = node_neg(Prec, _, Status),
+        (
+            Status = undecided
         % An exception must have been thrown inside the negation,
         % so we don't consider it a separate context.
-        Next = Prec
     ;
-        throw(internal_error("step_left_in_contour", "unexpected NEGE node"))
+            ( Status = failed
+            ; Status = succeeded
+            ),
+            % We are at the left end of a contour, so we cannot step any
+            % further.
+            throw(internal_error("step_left_in_contour",
+                "unexpected NEGE node"))
+        )
+    ;
+        % In these cases we have reached a dead end, so we step to the
+        % previous contour instead.
+        ( Node = node_fail(_, _, _, _, _, _)
+        ; Node = node_redo(_, _, _, _, _)
+        ; Node = node_neg_fail(_, _, _)
+        ),
+        find_prev_contour(Store, Node, Prec)
     ).
-    %
-    % In the remaining cases we have reached a dead end, so we
-    % step to the previous contour instead.
-    %
-step_left_in_contour(Store, Node) = Prec :-
-    Node = node_fail(_, _, _, _, _, _),
-    find_prev_contour(Store, Node, Prec).
-step_left_in_contour(Store, Node) = Prec :-
-    Node = node_redo(_, _, _, _, _),
-    find_prev_contour(Store, Node, Prec).
-step_left_in_contour(Store, Node) = Prec :-
-    Node = node_neg_fail(_, _, _),
-    find_prev_contour(Store, Node, Prec).
 
     % Given any node which is not on a contour, find a node on
     % the previous contour in the same stratum.
@@ -652,58 +666,85 @@
     ;       node_redo(ground, ground, ground, ground, ground)
     ;       node_neg_fail(ground, ground, ground).
 
-find_prev_contour(Store, node_fail(_, Call, _, _, _, _), OnContour) :-
+find_prev_contour(Store, Node, OnContour) :-
+    (
+        Node = node_fail(_, Call, _, _, _, _),
     call_node_from_id(Store, Call, CallNode),
-    OnContour = CallNode ^ call_preceding.
-find_prev_contour(Store, node_redo(_, Exit, _, _, _), OnContour) :-
+        OnContour = CallNode ^ call_preceding
+    ;
+        Node = node_redo(_, Exit, _, _, _),
     exit_node_from_id(Store, Exit, ExitNode),
-    OnContour = ExitNode ^ exit_preceding.
-find_prev_contour(Store, node_neg_fail(_, Neg, _), OnContour) :-
-    neg_node_from_id(Store, Neg, node_neg(OnContour, _, _)).
-    %
-    % The following cases are at the left end of a contour,
-    % so there are no previous contours in the same stratum.
-    %
-find_prev_contour(_, node_call(_, _, _, _, _, _, _, _, _, _), _) :-
-    throw(internal_error("find_prev_contour", "reached CALL node")).
-find_prev_contour(_, node_cond(_, _, _), _) :-
-    throw(internal_error("find_prev_contour", "reached COND node")).
-find_prev_contour(_, node_neg(_, _, _), _) :-
-    throw(internal_error("find_prev_contour", "reached NEGE node")).
-
-step_in_stratum(Store, node_exit(_, Call, MaybeRedo, _, _, _, _, _)) =
-    step_over_redo_or_call(Store, Call, MaybeRedo).
-step_in_stratum(Store, node_fail(_, Call, MaybeRedo, _, _, _)) =
-    step_over_redo_or_call(Store, Call, MaybeRedo).
-step_in_stratum(Store, node_excp(_, Call, MaybeRedo, _, _, _, _)) =
-    step_over_redo_or_call(Store, Call, MaybeRedo).
-step_in_stratum(Store, node_redo(_, Exit, _, _, _)) = Next :-
+        OnContour = ExitNode ^ exit_preceding
+    ;
+        Node = node_neg_fail(_, Neg, _),
+        neg_node_from_id(Store, Neg, node_neg(OnContour, _, _))
+    ;
+        % These cases are at the left end of a contour, so there are
+        % no previous contours in the same stratum.
+        (
+            Node = node_call(_, _, _, _, _, _, _, _, _, _),
+            throw(internal_error("find_prev_contour", "reached CALL node"))
+        ;
+            Node = node_cond(_, _, _),
+            throw(internal_error("find_prev_contour", "reached COND node"))
+        ;
+            Node = node_neg(_, _, _),
+            throw(internal_error("find_prev_contour", "reached NEGE node"))
+        )
+    ).
+
+step_in_stratum(Store, Node) = Next :-
+    (
+        Node = node_exit(_, Call, MaybeRedo, _, _, _, _, _),
+        Next = step_over_redo_or_call(Store, Call, MaybeRedo)
+    ;
+        Node = node_fail(_, Call, MaybeRedo, _, _, _),
+        Next = step_over_redo_or_call(Store, Call, MaybeRedo)
+    ;
+        Node = node_excp(_, Call, MaybeRedo, _, _, _, _),
+        Next = step_over_redo_or_call(Store, Call, MaybeRedo)
+    ;
+        Node = node_redo(_, Exit, _, _, _),
     exit_node_from_id(Store, Exit, ExitNode),
-    Next = ExitNode ^ exit_preceding.
-step_in_stratum(_, node_switch(Next, _)) = Next.
-step_in_stratum(_, node_first_disj(Next, _)) = Next.
-step_in_stratum(_, node_later_disj(Next, _, _)) = Next.
-step_in_stratum(_, node_cond(Prec, _, Status)) = Next :-
-    ( Status = failed ->
+        Next = ExitNode ^ exit_preceding
+    ;
+        ( Node = node_switch(Next, _)
+        ; Node = node_first_disj(Next, _)
+        ; Node = node_later_disj(Next, _, _)
+        )
+    ;
+        Node = node_cond(Prec, _, Status),
+        (
+            Status = failed,
         throw(internal_error("step_in_stratum", "failed COND node"))
     ;
+            ( Status = succeeded
+            ; Status = undecided
+            ),
         Next = Prec
-    ).
-step_in_stratum(_, node_then(Next, _, _)) = Next.
-step_in_stratum(Store, node_else(_, Cond, _)) = Next :-
-    cond_node_from_id(Store, Cond, node_cond(Next, _, _)).
-step_in_stratum(Store, node_neg_succ(_, Neg, _)) = Next :-
-    neg_node_from_id(Store, Neg, node_neg(Next, _, _)).
-step_in_stratum(Store, node_neg_fail(_, Neg, _)) = Next :-
-    neg_node_from_id(Store, Neg, node_neg(Next, _, _)).
-    %
-    % The following cases mark the boundary of the stratum,
+        )
+    ;
+        Node = node_then(Next, _, _)
+    ;
+        Node = node_else(_, Cond, _),
+        cond_node_from_id(Store, Cond, node_cond(Next, _, _))
+    ;
+        Node = node_neg_succ(_, Neg, _),
+        neg_node_from_id(Store, Neg, node_neg(Next, _, _))
+    ;
+        Node = node_neg_fail(_, Neg, _),
+        neg_node_from_id(Store, Neg, node_neg(Next, _, _))
+    ;
+        % These cases mark the boundary of the stratum,
     % so we cannot step any further.
-    %
-step_in_stratum(_, node_call(_, _, _, _, _, _, _, _, _, _)) = _ :-
-    throw(internal_error("step_in_stratum", "unexpected CALL node")).
-step_in_stratum(_, node_neg(_, _, _)) = _ :-
-    throw(internal_error("step_in_stratum", "unexpected NEGE node")).
+        (
+            Node = node_call(_, _, _, _, _, _, _, _, _, _),
+            throw(internal_error("step_in_stratum", "unexpected CALL node"))
+        ;
+            Node = node_neg(_, _, _),
+            throw(internal_error("step_in_stratum", "unexpected NEGE node"))
+        )
+    ).
 
 :- func step_over_redo_or_call(S, R, R) = R <= annotated_trace(S, R).
 
@@ -864,7 +905,6 @@
     ),
     % The last interface is the second field, so we pass 1
     % (since argument numbers start from 0).
-    %
     set_trace_node_arg(Call1, 1, Last, Call).
 
 :- func call_node_update_implicit_tree_info(trace_node(trace_node_id)::di,
@@ -883,7 +923,6 @@
     ),
     % call_at_max_depth is the sixth field, so we pass 5
     % (since argument numbers start from 0).
-    %
     set_trace_node_arg(Call1, 5, yes(implicit_tree_info(IdealDepth)), Call).
 
 :- func get_implicit_tree_ideal_depth(trace_node(trace_node_id)) = int.
@@ -919,7 +958,6 @@
     ),
     % The goal status is the third field, so we pass 2
     % (since argument numbers start from 0).
-    %
     set_trace_node_arg(Cond1, 2, Status, Cond).
 
 :- func neg_node_set_status(trace_node(trace_node_id)::di, goal_status::di)
@@ -936,7 +974,6 @@
     ),
     % The goal status is the third field, so we pass 2
     % (since argument numbers start from 0).
-    %
     set_trace_node_arg(Neg1, 2, Status, Neg).
 
 :- pred set_trace_node_arg(trace_node(trace_node_id)::di, int::in, T::di,
@@ -1404,9 +1441,8 @@
 convert_node(_, _) :-
     private_builtin.sorry("convert_node").
 
-    % Given a node in an annotated trace, return a reference to
-    % the preceding node in the trace, or a NULL reference if
-    % it is the first.
+    % Given a node in an annotated trace, return a reference to the preceding
+    % node in the trace, or a NULL reference if it is the first.
     %
 :- func preceding_node(trace_node(T)) = T.
 
@@ -1501,8 +1537,7 @@
     Arg = arg_info(UserVis, _, _),
     (
         UserVis = no,
-        arg_num_to_head_var_num(Args, ArgNum - 1, CurArgNum,
-            UserArgNum)
+        arg_num_to_head_var_num(Args, ArgNum - 1, CurArgNum, UserArgNum)
     ;
         UserVis = yes,
         ( ArgNum = 1 ->
Index: browser/declarative_tree.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/declarative_tree.m,v
retrieving revision 1.54
diff -u -b -r1.54 declarative_tree.m
--- browser/declarative_tree.m	23 Nov 2007 07:34:51 -0000	1.54
+++ browser/declarative_tree.m	27 Nov 2007 03:14:07 -0000
@@ -1440,11 +1440,25 @@
                 ;
                     % Perhaps this is a closure and the argument was passed in
                     % when the closure was created.
-                    ( AtomicGoal = higher_order_call_rep(Closure, _) ->
+                    (
+                        AtomicGoal = higher_order_call_rep(Closure, _),
                         Var = Closure,
                         MaybePrims = yes(
                             primitive_list_and_var(Primitives0, Var, yes))
                     ;
+                        ( AtomicGoal = unify_construct_rep(_, _, _)
+                        ; AtomicGoal = unify_deconstruct_rep(_, _, _)
+                        ; AtomicGoal = partial_deconstruct_rep(_, _, _)
+                        ; AtomicGoal = partial_construct_rep(_, _, _)
+                        ; AtomicGoal = unify_assign_rep(_, _)
+                        ; AtomicGoal = cast_rep(_, _)
+                        ; AtomicGoal = unify_simple_test_rep(_, _)
+                        ; AtomicGoal = pragma_foreign_code_rep(_)
+                        ; AtomicGoal = method_call_rep(_, _, _)
+                        ; AtomicGoal = plain_call_rep(_, _, _)
+                        ; AtomicGoal = builtin_call_rep(_, _, _)
+                        ; AtomicGoal = event_call_rep(_, _)
+                        ),
                         throw(internal_error("make_primitive_list",
                             "argument number mismatch"))
                     )
Index: browser/declarative_user.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/declarative_user.m,v
retrieving revision 1.67
diff -u -b -r1.67 declarative_user.m
--- browser/declarative_user.m	19 Jan 2007 07:03:58 -0000	1.67
+++ browser/declarative_user.m	27 Nov 2007 03:04:03 -0000
@@ -1074,24 +1074,46 @@
         !.User ^ testing = no,
         write_decl_bug(Bug, !.User, !IO),
         get_command("Is this a bug? ", Command, !User, !IO),
-        ( Command = user_cmd_yes ->
+        (
+            Command = user_cmd_yes,
             Response = confirm_bug
-        ; Command = user_cmd_no ->
+        ;
+            Command = user_cmd_no,
             Response = overrule_bug
-        ; Command = user_cmd_quit ->
+        ;
+            Command = user_cmd_quit,
             Response = abort_diagnosis
-        ; Command = user_cmd_browse_arg(MaybeArgNum) ->
+        ;
+            Command = user_cmd_browse_arg(MaybeArgNum),
             browse_decl_bug(Bug, MaybeArgNum, !User, !IO),
             user_confirm_bug(Bug, Response, !User, !IO)
-        ; Command = user_cmd_browse_xml_arg(MaybeArgNum) ->
+        ;
+            Command = user_cmd_browse_xml_arg(MaybeArgNum),
             browse_xml_decl_bug(Bug, MaybeArgNum, !.User, !IO),
             user_confirm_bug(Bug, Response, !User, !IO)
-        ; Command = user_cmd_browse_io(ActionNum) ->
+        ;
+            Command = user_cmd_browse_io(ActionNum),
             decl_bug_io_actions(Bug, MaybeIoActions),
             browse_chosen_io_action(MaybeIoActions, ActionNum, _MaybeTrack,
                 !User, !IO),
             user_confirm_bug(Bug, Response, !User, !IO)
         ;
+            ( Command = user_cmd_ask
+            ; Command = user_cmd_change_search(_)
+            ; Command = user_cmd_empty
+            ; Command = user_cmd_help(_)
+            ; Command = user_cmd_illegal
+            ; Command = user_cmd_inadmissible
+            ; Command = user_cmd_info
+            ; Command = user_cmd_param_command(_)
+            ; Command = user_cmd_pd
+            ; Command = user_cmd_print_arg(_, _)
+            ; Command = user_cmd_print_io(_, _)
+            ; Command = user_cmd_skip
+            ; Command = user_cmd_trust_module
+            ; Command = user_cmd_trust_predicate
+            ; Command = user_cmd_undo
+            ),
             user_confirm_bug_help(!.User, !IO),
             user_confirm_bug(Bug, Response, !User, !IO)
         )
Index: browser/interactive_query.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/interactive_query.m,v
retrieving revision 1.30
diff -u -b -r1.30 interactive_query.m
--- browser/interactive_query.m	31 Aug 2006 11:09:48 -0000	1.30
+++ browser/interactive_query.m	27 Nov 2007 03:05:18 -0000
@@ -216,19 +216,22 @@
 
 run_query(Options, Program, !IO) :-
     SourceFile = query_module_name ++ ".m",
-    io.get_environment_var("MERCURY_OPTIONS", MAYBE_MERCURY_OPTIONS, !IO),
-    ( MAYBE_MERCURY_OPTIONS = yes(MERCURY_OPTIONS) ->
+    io.get_environment_var("MERCURY_OPTIONS", MaybeMercuryOptions, !IO),
+    (
+        MaybeMercuryOptions = yes(MercuryOptions),
         io.set_environment_var("MERCURY_OPTIONS", "", !IO),
         write_prog_to_file(Program, SourceFile, !IO),
         compile_file(Options, Succeeded, !IO),
-        ( Succeeded = yes ->
+        (
+            Succeeded = yes,
             dynamically_load_and_run(!IO)
         ;
-            true
+            Succeeded = no
         ),
         cleanup_query(Options, !IO),
-        io.set_environment_var("MERCURY_OPTIONS", MERCURY_OPTIONS, !IO)
+        io.set_environment_var("MERCURY_OPTIONS", MercuryOptions, !IO)
     ;
+        MaybeMercuryOptions = no,
         print("Unable to unset MERCURY_OPTIONS environment variable", !IO)
     ).
 
@@ -540,17 +543,21 @@
         true
     ),
     io.call_system(Command, Result, !IO),
-    ( Result = ok(0) ->
+    (
+        Result = ok(Status),
+        ( Status = 0 ->
         ( verbose = yes ->
             print("% done.\n", !IO)
         ;
             true
         ),
         Succeeded = yes
-    ; Result = ok(_) ->
+        ;
         print("Compilation error(s) occurred.\n", !IO),
         Succeeded = no
+        )
     ;
+        Result = error(_),
         print("Error: unable to invoke the compiler.\n", !IO),
         Succeeded = no
     ).
Index: browser/parse.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/parse.m,v
retrieving revision 1.34
diff -u -b -r1.34 parse.m
--- browser/parse.m	1 Dec 2006 15:03:44 -0000	1.34
+++ browser/parse.m	27 Nov 2007 03:11:35 -0000
@@ -421,29 +421,30 @@
         )
     ->
         (
-            ArgTokens = []
-        ->
+            ArgTokens = [],
             HowTrack = track_fast,
             MaybePath = no
         ;
-            ( ArgTokens = [arg("accurate")] 
-            ; ArgTokens = [arg("a")] 
+            ArgTokens = [HeadArgToken | TailArgTokens],
+            (
+                ( HeadArgToken = arg("accurate")
+                ; HeadArgToken = arg("a")
             ) 
         ->
             HowTrack = track_accurate,
+                (
+                    TailArgTokens = [],
             MaybePath = no
         ; 
-            ( ArgTokens = [arg("accurate") | Rest] 
-            ; ArgTokens = [arg("a") | Rest]
-            )
-        ->
-            HowTrack = track_accurate,
-            parse_path(Rest, Path),
+                    TailArgTokens = [_ | _],
+                    parse_path(TailArgTokens, Path),
             MaybePath = yes(Path)
+                )
         ;
             HowTrack = track_fast,
             parse_path(ArgTokens, Path),
             MaybePath = yes(Path)
+            )
         ),
         Command = track(HowTrack, AssertInvalid, MaybePath)
     ;
Index: browser/sized_pretty.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/sized_pretty.m,v
retrieving revision 1.17
diff -u -b -r1.17 sized_pretty.m
--- browser/sized_pretty.m	1 Dec 2006 15:03:44 -0000	1.17
+++ browser/sized_pretty.m	27 Nov 2007 03:03:20 -0000
@@ -510,7 +510,8 @@
         HeadArg = yes(X),
         X = _ - STerm,
         Size = extract_size_from_annotation(STerm),
-        ( STerm = exact(_, _, _, _, _) ->
+        (
+            STerm = exact(_, _, _, _, _),
             ( compare_measures(ArgLimit, Size) = (<) ->
                 check_args(Params, Rest, ArgLimit, Passed, !Used)
             ;
@@ -519,6 +520,7 @@
                 check_args(Params, Rest, ArgLimit, PassedRest, !Used)
             )
         ;
+            STerm = at_least(_, _, _),
             check_args(Params, Rest, ArgLimit, Passed, !Used)
         )
     ;
@@ -947,10 +949,12 @@
     deconstruct_browser_term_cc(BrowserDb, BrowserTerm, Functor, ActualArity,
         Args, MaybeReturn),
     FSize = string.length(Functor) + 2 * (ActualArity),
-    ( Check = yes ->
+    (
+        Check = yes,
         get_arg_length(Args, TotalLength, MaxArgLength),
         int.max(MaxArgLength, (string.length(Functor) + 1), MaxLength)
     ;
+        Check = no,
         TotalLength = 0,
         MaxLength = 0
     ),
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/standalone_c
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing ssdb
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list