mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 21:35:49 +00:00
Estimated hours taken: 1 Make all the modules in the browser library sub-modules of module `mdb', to avoid link errors when users use module names such as `parse'. browser/Mmakefile: browser/browser_library.m: browser/mdb.m: Rename browser_library.m to mdb.m. Change `:- import_module' declarations to `:- include_module' declarations. browser/Mmakefile: Remove the special case rule for `mer_browser.init' -- it doesn't work when the file names are not the same as the module name. Instead, the default rule for `mdb.init' is used and the output is copied to `mer_browser.init'. browser/.cvsignore: Rename header files, etc. browser/*.m: Add a `mdb__' prefix to the names of modules in the browser library in `:- module' and `:- import_module' declarations. trace/*.c: Rename the header files for the browser library in `#include' statements. tests/hard_coded/Mmakefile: tests/hard_coded/parse.m: tests/hard_coded/parse.exp: Test case.
68 lines
1.6 KiB
Mathematica
68 lines
1.6 KiB
Mathematica
%-----------------------------------------------------------------------------%
|
|
% Copyright (C) 1999-2000 The University of Melbourne.
|
|
% This file may only be copied under the terms of the GNU Library General
|
|
% Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
%-----------------------------------------------------------------------------%
|
|
% File: declarative_test.m
|
|
% Author: Mark Brown
|
|
%
|
|
% This module is a stand-alone version of the front end, suitable for
|
|
% testing.
|
|
|
|
:- module declarative_test.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state, io__state).
|
|
:- mode main(di, uo) is det.
|
|
|
|
:- implementation.
|
|
:- import_module mdb, mdb__declarative_debugger, mdb__declarative_execution.
|
|
:- import_module list, std_util, map, require.
|
|
|
|
main -->
|
|
process_arguments(MaybeFile),
|
|
(
|
|
{ MaybeFile = yes(File) }
|
|
->
|
|
load_trace_node_map(File, Map, Key),
|
|
io__stdin_stream(StdIn),
|
|
io__stdout_stream(StdOut),
|
|
{ diagnoser_state_init(StdIn, StdOut, State) },
|
|
diagnosis(Map, Key, Response, State, _),
|
|
io__write_string("Diagnoser response:\n"),
|
|
io__write(Response),
|
|
io__nl
|
|
;
|
|
usage
|
|
).
|
|
|
|
:- pred process_arguments(maybe(io__input_stream),
|
|
io__state, io__state).
|
|
:- mode process_arguments(out, di, uo) is det.
|
|
|
|
process_arguments(MaybeFile) -->
|
|
io__command_line_arguments(Args),
|
|
(
|
|
{ Args = [FileName] }
|
|
->
|
|
io__open_input(FileName, Res),
|
|
(
|
|
{ Res = ok(File) }
|
|
->
|
|
{ MaybeFile = yes(File) }
|
|
;
|
|
{ MaybeFile = no }
|
|
)
|
|
;
|
|
{ MaybeFile = no }
|
|
).
|
|
|
|
:- pred usage(io__state, io__state).
|
|
:- mode usage(di, uo) is det.
|
|
|
|
usage -->
|
|
io__progname_base("declarative_test", Name),
|
|
io__write_strings(["Usage: ", Name, " <filename>\n"]).
|
|
|