6 Commits

Author SHA1 Message Date
Zoltan Somogyi
781d827ca1 Don't allow stubs in the browser directory.
browser/Mmakefile:
    Do not specify --allow-stubs.

browser/*.m:
    We used to use --allow-stubs to allow us to get away with
    predicate definitions containing a foreign_proc for C and
    no definition for Java or C#.

    Stop relying on --allow-stubs by providing a Mercury clause
    (which throws an exception) for every predicate defined by
    a foreign_proc in C.

    Put short lines around predicates defined in this way,
    to make clear which blocks of text are related.

    Delete old Java and sometimes C# foreign_procs that throw
    an exception in those languages, since the Mercury version
    is shorter, simpler, and works for both languages.

    In a few cases, fix formatting.
2025-10-09 05:18:37 +11:00
Julien Fischer
52836d4726 Update copyright notices in browser directory.
browser/*.m:
    As above.
2024-12-16 20:42:14 +11:00
Zoltan Somogyi
9047bdbf05 Improve programming style in the browser directory.
browser/declarative_analyser.m:
browser/declarative_debugger.m:
browser/declarative_oracle.m:
browser/declarative_tree.m:
browser/declarative_user.m:
browser/interactive_query.m:
browser/listing.m:
browser/parse.m:
browser/util.m:
    Rename some predicates to avoid ambiguity.

    Factor out common code.

    If some versions of a field of a structure have names in a predicate
    (by being stored in a named variable), then give all *other* versions
    of that field in that structure names in that predicate as well.

    If a field of a structure is used more than once in a predicate,
    then again, store it in a named variable.

    Reorder predicate arguments to put state variables last.

    Use io.format instead of sequences of calls to io.write_string.

    In declarative_user.m, note a probable bug (in a position where
    it is probably rarely stumbled upon).

    In listing.m, use a consistent naming scheme to differentiate
    between Mercury streams and their C counterparts.

    Replace if-then-else chains with switches where possible.

browser/name_mangle.m:
    Note bit rot.

browser/browse.m:
    Conform to the changes above.

library/io.m:
    Improve predicate and variable names.

browser/mdb.m:
browser/mer_browser.m:
browser/percent_encoding.m:
browser/term_rep.m:
browser/tree234_cc.m:
library/library.m:
    Improve comments.
2022-07-03 13:55:54 +10:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Zoltan Somogyi
e5c7e1c92e Fix a namespace pollution problem.
browser/percent_encoding.m:
    Make this module a submodule of mdb.m. Without this, the Mercury compiler
    creates symbol names for its exported predicates that do not begin with
    one of the prefixes reserved for the Mercury implementation, thus
    potentially clashing with symbols that may be used by user code.

browser/mdb.m:
    Add the new module to this package.

browser/term_to_html.m:
    Update the import of percent_encoding.m.
2017-08-17 06:49:36 +10:00
Peter Wang
0d273769fc Add web browser-based term browsing in the debugger.
browser/browse.m:
    Add save_and_browse_browser_term_web to be called when
    "browse --web" is entered at the mdb prompt.

    Add browser_term_to_html_flat_string, a helper predicate for
    term_to_html.

    Make portray_flat_write_browser_term work take a stream parameter
    instead of writing to the current output stream. It is called by
    browser_term_to_html_flat_string, writing to a string builder
    stream.

browser/browser_info.m:
    Add web_browser_cmd field to browser_persistent_state.

browser/mdb.m:
browser/term_to_html.m:
    Add new module to generate an HTML document. The document contains a
    JavaScript represention of a Mercury term.

    (The JavaScript string escaping code is adapted from Julien's
    mercury-json project.)

browser/percent_encoding.m:
    Add new module to perform percent-encoding.

scripts/mdb_term_browser.css:
scripts/mdb_term_browser.js:
    Add JavaScript and CSS files referenced by the generated HTML file
    to create a tree view of a Mercury term using jstree.

scripts/32px.png:
scripts/40px.png:
scripts/throbber.gif:
scripts/jstree.min.js:
scripts/jstree.style.min.css:
    Add local copy of jstree files <https://www.jstree.com/>

scripts/jquery.slim.min.js:
    Add local copy of jquery <https://jquery.com/>

scripts/Mmakefile:
    Install the new files into the same directory as mdbrc and other
    mdb-related files.

trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_parameter.c:
trace/mercury_trace_cmd_parameter.h:
trace/mercury_trace_internal.c:
    Add "browse --web" and "web_browser_cmd" commands.

doc/user_guide.texi:
    Document "browse --web" and "web_browser_cmd" commands.

configure.ac:
scripts/mdbrc.in:
    Set a reasonable default command to launch a web browser from mdb.
    (Only tested on Linux.)

NEWS:
    Announce the new feature.

.README.in:
    Mention jquery and jstree licensing.

tests/debugger/Mmakefile:
tests/debugger/completion.exp:
tests/debugger/mdb_command_test.inp:
tests/debugger/save.exp2:
    Update debugger tests for new commands.
2017-08-15 16:14:55 +10:00