Replace __ with . as the module qualifier symbol.
Replace references to io.state with just io.
Replace DCGs with state variables.
Replace (C->T;E) syntax for if-then-elses with (if C then T else E) syntax.
Replace if-then-elses with switches when possible and where this does not
affect what is being tested.
Replace separate pred and mode declarations with predmode declarations.
Put predicate and function declarations just before the definition
of the predicate or function.
Delete unneeded module qualifications on predicate and function declarations
and definitions.
Update .exp files (and if needed, .inp files) for the line number changes
that result from the above.
For tests that have more than one .exp file and where one of those files
is affected by the above, add a section to the source file header that says
which .exp file is for what grade, with XXXs for the (as yet) unknown parts.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
Estimated hours taken: 5
Branches: main
Add a new mdb command, 'shell', that allows users to execute shell commands
from within the debugger.
Allow the user to give up to nine additional arguments to the 'source' command.
Occurrences of the strings "$1" through "$9" in the sourced file are replaced
by the corresponding additional arguments, allowing for parameterised scripts.
Use the two new features mentioned above to add two more mdb commands: one
to open a term, goal or exception in an external editor another command
to perform a grep on a term, goal or exception (useful for seeing if a value
occurs in a big map, for example).
NEWS
Mention the new commands.
doc/mdb_categories:
doc/user_guide.texi:
Document the new commands.
scripts/Mmakefile:
scripts/mdb_open:
scripts/mdb_vim:
Add scripts for the new commands.
scripts/mdbrc.in:
Add aliases for the new shell, emacs, grep and vim commands.
tests/debugger/completion.exp:
tests/debugger/mdb_command_test.inp:
Adjust for new commands.
tests/debugger/save.exp:
tests/debugger/save.exp2:
Adjust for new commands. Replace system dependent strings
with ZZZ instead of XXX.
tests/debugger/Mmakefile:
tests/debugger/shell.exp:
tests/debugger/shell.inp:
tests/debugger/shell.m:
tests/debugger/shell_test_script:
Test the shell and source commands.
trace/mercury_trace_cmd_misc.c:
Check if there are extra arguments to the source mdb command
and pass them to MR_trace_source if there are.
trace/mercury_trace_cmd_misc.h:
Add shell command handling function prototype.
trace/mercury_trace_declarative.c:
Call MR_trace_call_system_display_error_on_failure instead
of system when displaying benchmarking statistics for the
declarative debugger.
trace/mercury_trace_internal.c:
trace/mercury_trace_internal.h:
Implement the shell command and extend the source command
to handle the optional extra arguments.
trace/mercury_trace_readline.c:
trace/mercury_trace_readline.h:
Add a new function to read a line and replace all the
occurrences of "$[1-9]" with the corresponding value from an array.
Delete comments in the .c file that are duplicated in the .h file.
trace/mercury_trace_util.c:
trace/mercury_trace_util.h:
Implement MR_trace_call_system_display_error_on_failure that
executes a system call and displays an error message if the system
call terminates abnormally.