[m-rev.] for post-commit review: new "addr" command in term browser

Zoltan Somogyi zs at csse.unimelb.edu.au
Fri Sep 4 12:03:22 AEST 2009


On 31-Aug-2009, Ian MacLarty <maclarty at csse.unimelb.edu.au> wrote:
> > Note that this diff does not add documentation of the new browser command,
> > because I cannot find anyplace the existing browser commands are documented,
> > so I do not know where to add the documentation to.
> >
> 
> I think the only browser documentation is the online documentation
> provided by help/3 in browser/browse.m.

browser/browse.m:
	Document recently added commands.

browser/parse.m:
	Document the location of the documentation.

	Put the code in more logical order.

Zoltan.

cvs diff: Diffing .
Index: browse.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/browse.m,v
retrieving revision 1.74
diff -u -b -r1.74 browse.m
--- browse.m	30 Aug 2009 23:09:41 -0000	1.74
+++ browse.m	2 Sep 2009 01:26:42 -0000
@@ -803,9 +803,25 @@
 "Commands are:\n",
 "\t[print|p|ls] [format_options] [path]\n",
 "\t               -- print the specified subterm using the `browse' params\n",
+% "\t[d|display] [path]\n",
+% The display command is not yet implemented
+% "\t[w|write] [path]\n",
+% The write command is not yet implemented
+"\t[addr|memory_addr] [path]\n",
+"\t               -- print the raw memory address of the specified subterm\n",
 "\tcd [path]      -- cd to the specified subterm (default is root)\n",
 "\tcdr n path     -- repeatedly apply the cd command n times\n",
 "\tpwd            -- print the path to the current subterm\n",
+% How should we document the "[a|accurate]" option on [t|track|m|mark]?
+"\t[t|track] [path]\n",
+"\t               -- mark the specified subterm (default is current)\n",
+"\t                  for tracking, and quit\n",
+"\t[m|mark] [path]\n",
+"\t               -- mark the specified subterm (default is current)\n",
+"\t                  for tracking, asserting for the declarative debugger\n",
+"\t                  that it makes the current goal invalid\n",
+"\tmode [path]    -- show the mode of the specified subterm\n",
+"\t                  (default is current)\n",
 "\tformat [format_options] <flat|raw-pretty|verbose|pretty>\n",
 "\t               -- set the format\n",
 "\tdepth [format_param_options] <n>\n",
@@ -813,10 +829,8 @@
 "\twidth [format_param_options] <n>\n",
 "\tlines [format_param_options] <n>\n",
 "\tnum_io_actions <n>\n",
-"\t               -- set a parameter value\n",
+"\t               -- set the named parameter value\n",
 "\tparams         -- show format and parameter values\n",
-"\tmark [path]    -- mark the given subterm (default is current) and quit\n",
-"\tmode [path]    -- show the mode of a subterm (default is current)\n",
 "\tquit           -- quit browser\n",
 "\thelp           -- show this help message\n",
 "SICStus Prolog style commands are:\n",
Index: parse.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/parse.m,v
retrieving revision 1.36
diff -u -b -r1.36 parse.m
--- parse.m	30 Aug 2009 23:09:42 -0000	1.36
+++ parse.m	2 Sep 2009 01:26:40 -0000
@@ -372,6 +372,9 @@
 parse_cmd(CmdToken, ArgTokens, MaybeArgWords, Command) :-
     % Please keep the code recognizing commands in the same order
     % as the definition of the command type.
+
+    % If you add more commands, please update the documention printed
+    % by the help predicate in browse.m.
     (
         ( CmdToken = token_name("print")
         ; CmdToken = token_name("p")
@@ -567,15 +570,15 @@
         FormatCmd = format_param(MaybeOptionTable, setting_depth(Depth)),
         Command = cmd_param(FormatCmd)
     ;
-        CmdToken = token_name("params")
-    ->
-        Command = cmd_param(print_params)
-    ;
         CmdToken = token_name("num_io_actions")
     ->
         ArgTokens = [token_num(N)],
         Command = cmd_param(num_io_actions(N))
     ;
+        CmdToken = token_name("params")
+    ->
+        Command = cmd_param(print_params)
+    ;
         ( CmdToken = token_name("help")
         ; CmdToken = token_name("h")
         ; CmdToken = token_question
--------------------------------------------------------------------------
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