Commit Graph

815 Commits

Author SHA1 Message Date
Julien Fischer
ea4b27f57f Delete --fullarch.
The internal option --fullarch has been deprecated in favour of --target-arch
since 2014. Delete it and replace any uses with --target-arch.

compiler/options.m:
    As above.

scripts/Mercury.config.in:
scripts/Mercury.config.boostrap.in:
extras/windows_installer_generator/sample/Mercury.config:
    Conform to the above change.
2023-09-07 11:47:38 +10:00
Julien Fischer
ae1a5863a5 Fix usage message for moose.
extras/moose/moose.m:
    Fix copy-and-paste errors.
2023-09-04 01:19:46 +10:00
Zoltan Somogyi
becb725dd4 Bring log4m.m's style up to date. 2023-07-24 12:53:48 +02:00
Julien Fischer
bbd1a9d138 Avoid warnings from MSVC in extras.
extras/odbc/odbc.m:
extras/log4m/log4.m:
    As above.
2023-07-24 15:20:03 +10:00
Zoltan Somogyi
3d756f61cd Put varsets before vars in write_variable.
library/term_io.m:
    Put the varset before the variable, the item to be written out,
    in the various versions of the write_variable operation.
    The new argument order

    - fits in better with the versions of write_term, which also put
      the varset before the item to be written out, and

    - allows the convenient use of fold operations that write out
      several variables.

NEWS.md:
    Announce the change, though only for the versions that existed
    before yesterday :-)

compiler/inst_graph.m:
extras/moose/mercury_syntax.m:
    Conform to the change.
2023-07-04 16:35:01 +02:00
Julien Fischer
13f01c98bd Ignore .obj files.
extras/.gitignore:
samples/.gitignore:
    As above.
2023-07-02 02:41:56 +10:00
Zoltan Somogyi
a5f9cb6851 Reduce differences between interpreter.m versions.
extras/trailed_update/samples/interpreter.m:
samples/interpreter.m:
    We have these two different versions of a pure Prolog interpreter
    as examples of Mercury code. Reduce the number of unneeded points
    of difference between them, by copying the better code at each such point
    to the other file.

tests/debugger/interpreter.m:
    This file is automatically copied from samples/interpreter.m.

tests/debugger/interpreter.exp:
    Expect the changes caused by the update to the source file.
2023-06-22 14:54:59 +02:00
Julien Fischer
c912aa4313 Fix compilation of extras/base64.
extras/base64/base64.m:
    Fix character escaping in a foreign_proc body.
2023-06-20 12:42:26 +10:00
Julien Fischer
1a95515413 Replace calls to obsolete predicates.
extras/moose/mercury_syntax.m:
extras/moose/moose.m:
    As above.
2023-06-20 11:52:32 +10:00
Julien Fischer
39fa7ddb47 Replace calls to obsolete predicates.
extras/cgi/cgi.m:
extras/moose/grammar.m:
    As above.

extras/curs/curs.panel.m:
    Delete an unused import.
2023-06-19 23:12:44 +10:00
Julien Fischer
2a366cf295 Deprecate --no-ansi and --no-ansi-c.
--no-ansi (mgnuc) and --no-ansi-c (mmc) have not actually done anything for
many years now. Deprecate these options and remove their "use" throughout most
of the Mercury system. (The remaining uses are in the Makefiles for the Boehm
GC, which need to be updated separately.)

Also deprecate the internal compiler option --cflags-for-ansi.

compiler/options.m:
    Document that --no-ansi-c is now deprecated.

    Document that the internal option --cflags-for-ansi is now
    deprecated.

compiler/compile_target_code.m:
    Do not pass the ANSI options to the C compiler.

scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
    Deprecate the --no-ansi option; delete code that no longer does
    anything useful.

configure.ac:
    Delete the configuration variable CFLAGS_FOR_ANSI; it is only ever
    set to be empty. (The comment talks about --no-ansi doing other things
    in the mgnuc script. It used to also cause some preprocessor macros
    to be defined for compatibility with the system headers on some
    platforms -- that has not been the case since 2013.)

doc/user_guide.texi:
    Document that --no-ansi-c is deprecated.

bytecode/Mmakefile:
compiler/Mercury.options:
library/Mercury.options:
extras/odbc/odbc.m:
runtime/Mmakefile:
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
tests/hard_coded/Mercury.options:
tests/valid/Mercury.options:
trace/Mmakefile:
util/Mmakefile:
    Conform to the above change.

NEWS.md:
    Announce the above.
2023-05-31 17:44:26 +10:00
Julien Fischer
6faef40e9e Fix spelling.
extras/moose/check.m:
    As above.
2023-04-03 21:09:24 +10:00
Zoltan Somogyi
9b6390b17e Bring the programming style of extras up to date.
extras/curs/curs.m:
extras/curs/curs.panel.m:
    Make panel a separate submodule of curs, not a nested submodule.

extras/base64/base64.m:
extras/curses/mcurses.basics.m:
extras/curses/mcurses.m:
extras/curses/mcurses.misc.m:
extras/curses/mcurses.user.m:
extras/gator/evolve.m:
extras/gator/genotype.m:
extras/gator/phenotype.m:
extras/gator/tausworthe3.m:
extras/monte/dots.m:
extras/monte/geom.m:
extras/monte/hg.m:
extras/monte/monte.m:
extras/monte/rnd.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/mopenssl/mopenssl.m:
extras/net/echo.m:
extras/net/errno.m:
extras/net/getaddrinfo.m:
extras/net/net.m:
extras/net/netdb.m:
extras/net/sockets.m:
extras/net/streams.m:
extras/net/tcp.m:
extras/net/test_lookups.m:
extras/net/types.m:
extras/odbc/odbc.m:
extras/odbc/odbc_test.m:
extras/references/README:
extras/references/reference.m:
extras/references/scoped_update.m:
extras/solver_types/library/any.m:
extras/solver_types/library/any_array.m:
extras/solver_types/library/any_assoc_list.m:
extras/solver_types/library/any_list.m:
extras/solver_types/library/any_map.m:
extras/solver_types/library/any_tree234.m:
extras/solver_types/library/any_util.m:
extras/trail/trail.m:
extras/trailed_update/samples/interpreter.m:
extras/trailed_update/samples/vqueens.m:
extras/trailed_update/tests/var_test.m:
extras/trailed_update/tr_array.m:
extras/trailed_update/tr_store.m:
extras/trailed_update/trailed_update.m:
extras/trailed_update/unsafe.m:
extras/trailed_update/var.m:
    Bring programming style up to date.
2023-03-30 21:48:10 +11:00
Julien Fischer
b955ef9024 Fix spelling.
extras/lex/regex.m:
    As above.
2023-03-12 14:44:02 +11:00
Julien Fischer
93dba486ec Update programming style in extras/lex.
extras/lex/lex.buf.m:
extras/lex/lex.lexeme.m:
extras/lex/lex.convert_NFA_to_DFA.m:
    As above.
2023-03-12 14:36:49 +11:00
Julien Fischer
7e10820891 Update programming style.
extras/lex/tests/test_regex.m:
    As above.

    Delete an unused function, that the stdlib now provides
    in any case.
2023-03-11 14:34:50 +11:00
Julien Fischer
52fc3915e7 Update extras/references.
extra/references/c_reference.h:
     Replace refernces to the old c_header_code and c_code
     pragmas.
2023-02-25 12:59:54 +11:00
Julien Fischer
9da35ef306 Replace the use '--' as a module qualifier.
Use typed insts.

extras/solver_types/library/*.m:
    As above.
2023-02-14 18:25:59 +11:00
Julien Fischer
b58aab912c Use a typed inst in a spot.
extras/align_right/align_right.m:
    As above.
2023-02-14 18:24:08 +11:00
Julien Fischer
4b28829101 Use typed insts in extras/lex.
extras/lex/lex.automata.m:
extras/lex/lex.buf.m:
extras/lex/lex.lexeme.m:
extras/lex/lex.m:
    As above.
2023-02-14 17:04:26 +11:00
Julien Fischer
a2db163e56 Use a typed inst in spot.
extras/windows_installer_generator/sample/gen_merc_wxs.m:
    As above.
2023-02-14 16:49:09 +11:00
Julien Fischer
c4358adeeb Fix the windows installer generator sample
extras/windows_installer_generator/sample/gen_merc_wxs.m:
    Get this compiling again.

    Add a vim modeline; convert tabs to spaces.
2023-02-14 16:46:51 +11:00
Julien Fischer
df5b302a60 Update more links.
extras/windows_installer_generator/sample/gen_merc_wxs.m:
    As above.

    Delete trailing whitespace.
2023-02-14 16:32:08 +11:00
Julien Fischer
844e8cb9fa Fix my previous commit.
extras/odbc/odbc.m:
    Use the correct link to the tech report.
2023-02-14 16:20:09 +11:00
Julien Fischer
e54727a01b Update a link to the papers page.
extras/odbc/odbc.m:
    As above.
2023-02-14 16:16:44 +11:00
Julien Fischer
41193dc437 Adjust some documentation for the Tcl/Tk binding.
extras/graphics/mercury_tcltk/Mmakefile.MacOSX:
extras/graphics/mercury_tcltk/README:
     As above.
2023-02-13 21:05:09 +11:00
Darren Bane
d2b26c759c Document how to use the Homebrew version of Tcl/Tk. 2023-02-13 21:02:47 +11:00
Darren Bane
7d349d0074 Fix build of extras/net on macOS. 2023-02-10 22:33:36 +11:00
Julien Fischer
500d125f03 Avoid calls to obsolete functions.
extras/lex/regex.m:
    As above.
2023-02-08 22:19:59 +11:00
Julien Fischer
5274170784 Make characters an instance of the uenum typeclass
The recent change to sparse_bitsets broke the lex library in extras.
Specifically, we now now need to make characters an instance of the
uenum typeclass. This diff does so.

library/char.m:
     Add predicates and functions for converting between unsigned integers
     and characters.

     Make characters an instance of the uenum typeclass.

tests/hard_coded/Mmakefile:
tests/hard_coded/char_uint_conv.{m,exp,exp2}:
     Add a test of the above conversions.

NEWS:
     Announce the additions.

extras/lex/lex.m:
     Conform to recent changes.
2022-12-20 20:18:54 +11:00
Julien Fischer
d7a606af4c Update moose to conform to stdlib changes.
extras/moose/check.m:
extras/moose/grammar.m:
extras/moose/mercury_syntax.m:
     As above.
2022-12-14 01:28:34 +11:00
Zoltan Somogyi
0c5fc71ad6 Bring extras/error/error.m up to date. 2022-11-30 18:26:00 +11:00
Zoltan Somogyi
4d15588c8b Address review comments.
NEWS:
    Mention that we do no longer accept : as module name separator.
    Improve wording.

extras/README.md:
    Document the new old_library_modules directory.

library/ops.m:
    Fix wording, and a dangling reference.

samples/calculator2.m:
    Update to use the new ops.m.
2022-11-12 01:36:32 +11:00
Zoltan Somogyi
de75b98b18 Make higher operator priorities bind tighter.
Mercury inherited its original system of operator priorities from Prolog,
because during its initial development, we wanted to be able execute
the Mercury compiler using NU-Prolog and later SICStus Prolog.
That consideration has long been obsolete, and now we may fix the
design error that gifted Prolog with its counter-intuitive system
of operator priorities, in which higher *numerical* operator priorities
mean lower *actual* priorities. This diff does that.

library/ops.m:
    Change the meaning of operator priorities, to make higher numerical
    priorities mean also higher actual priorities.

    This semantic change requires corresponding changes in any other module
    that uses ops.m. To force this change to occur, change the type
    representing priorities from being a synonym for a bare int to being
    a notag wrapper around an uint.

    The old "assoc" type had a misleading name, since it is related to
    associativity but is not itself a representation of associativity.
    Its two function symbols, which used to be just "x" and "y", meant that
    the priority of an argument must be (respectively) greater than,
    or greater than equal to, the priority of the operator. So rename
    x to arg_gt, y to arg_ge, and assoc to arg_prio_gt_or_ge.

    Rename the old adjust_priority_for_assoc predicate to min_priority_for_arg,
    which better expresses its semantics. Turn it into a function, since
    some of its users want it that way, and move its declaration to the
    public part of the interface.

    Add a method named tightest_op_priority to replace the use of 0
    as a priority.

    Rename the max_priority method as the loosest_op_priority method.

    Add a method named universal_priority to replace the use of
    max_priority + 1 as a priority.

    Add a function to return the priority of the comma operator,
    to allow other modules to stop hardcoding it.

    Add operations for comparing priorities and for incrementing/decrementing
    priorities.

    Change the prefix on the names of the predicates that take op_infos
    as inputs from "mercury_op_table_" to "op_infos_", since the old prefix
    was misleading.

    Add a note on an significant old problem with an exported type synonym.

library/mercury_term_parser.m:
    Conform to the changes above.

    Delete unnecessary module qualifiers, since they were just clutter.

    Add "XXX OPS" to note further opportunities for improvement.

library/pprint.m:
    Conform to the changes above.

    Rename a function to avoid ambiguity.

library/pretty_printer.m:
library/stream.string_writer.m:
library/string.to_string.m:
library/term_io.m:
    Conform to the changes above.

library/string.m:
    Add a note on an significant old problem.

NEWS:
    Announce the user-visible changes.

tests/hard_coded/bug383.m:
    Update this test case to use the new system of operator priorities.

tests/hard_coded/term_io_test.{m,inp}:
    Fix white space.

extras/old_library_modules/old_mercury_term_parser.m:
extras/old_library_modules/old_ops.m:
    The old contents of the mercury_term_parser and ops modules,
    in case anyone wants to continue using them instead of updating
    their code to use their updated equivalents.

samples/calculator2.m:
    Import the old versions of mercury_term_parser and ops.
2022-11-11 00:11:44 +11:00
Zoltan Somogyi
a2f89cb891 Give some predicates better names.
extras/xml/parsing.m:
    As above.

extras/xml/xml.parse.m:
extras/xml/xml.parse.chars.m:
    Conform to the change in parsing.m.
2022-06-25 06:45:51 +10:00
Zoltan Somogyi
ce14206488 Clean up several aspects of extras/xml.
extras/xml/parsing.m:
extras/xml/unicode.m:
extras/xml/xml.cat.m:
extras/xml/xml.doc.m:
extras/xml/xml.dtd.m:
extras/xml/xml.encoding.m:
extras/xml/xml.m:
extras/xml/xml.ns.m:
extras/xml/xml.parse.chars.m:
extras/xml/xml.parse.m:
    Use predmode declarations when possible.

    Flatten camelCase.

    Add prefixes to the names of function symbols and fields
    if this avoid ambiguity, either with other parts of this code,
    or with standard Mercury function symbols or predicates.

    Replace uses of graphic characters such as ',' and '-' as
    general purpose function symbols with normal, alphanumeric
    function symbols. (Uses of graphic characters to stand for themselves
    in xml.parse.chars.m are unaffected.)

    Replace uses of graphic symbols such as ',' '->' and '[|]' as type names.

    Improve some other names as well.

    Convert (C->T;E) to (if C then T else E).

    Replace tabs with spaces.

    Delete unused imports.

    Make the order of definitions match the order of declarations.

extras/xml/tryit.m:
    Put the code for handling a single command line argument into its own
    predicate.

    Replace see/seen with read_named_file_as_string.

    Avoid using !IO to pass around the parser state.

    Instead of writing out the parse tree as a single very long line,
    convert both the DTD and the HTML code to a prettyprinter doc,
    and print that. This makes the output actually readable, and
    also makes it usefully diffable as well.

extras/xml/Mmakefile:
    Replace the old do-nothing check action with one that actually does
    check whether the code in this directory can do at least one simple task,
    the one mentioned in in samples/README. It would be nice of we had
    more tests, more extensive tests, or (preferably) both, but that would
    require someone who knows the code significantly better than I do.

    Add a rule for making the tags file.

    Compile the modules in this directory with the same default mmc flags
    as we use in the compiler directory.

extras/xml/XML_FLAGS:
    The default flags for modules in this directory.

extras/xml/Mercury.options:
    The non-default flags for modules in this directory.

extras/xml/samples/newsarticles.exp:
    The expected output of running the updated tryit program on the
    (just one) sample input in this directory.

extras/xml/README:
extras/xml/samples/README:
    Replace some obsolete references, and improve formatting.
2022-06-24 07:26:55 +10:00
Peter Wang
3124fcfc06 Attribute memory allocations in mercury_cairo.
extras/graphics/mercury_cairo/*.m:
    As above.
2022-05-20 14:36:02 +10:00
Julien Fischer
8ef9073be2 Delete remaining references to --use-trail-segments.
doc/user_guide.texi:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
samples/solver_types/Mercury.options:
scripts/init_grade_options.sh-subr:
    As above.

RELEASE_NOTES_NEXT:
    Delete item concerning the above.
2022-04-18 21:45:15 +10:00
Julien Fischer
4099cca890 Minor cleanups for moose.
extras/moose/*.m:
    As above.
2022-04-18 00:00:09 +10:00
Julien Fischer
9939e4ccd8 Update syntax and formatting.
extras/fixed/fixed.m:
    As above.

    Replace a predicate with a call to a standard library
    predicate that provides the same functionality.
2022-04-15 20:18:28 +10:00
Julien Fischer
20e02c9833 Style and formatting updates.
extras/xml/*.m:
    As above.
2022-04-15 18:19:44 +10:00
Julien Fischer
96a225d56a Style and formatting updates.
extras/references/tests/*.m:
    As above.
2022-04-15 16:17:16 +10:00
Julien Fischer
84edc00f6f Delete uses of --trail-segments.
extras/references/samples/Mmakefile:
extras/references/tests/Mmakefile:
    As above.
2022-04-14 20:27:20 +10:00
Julien Fischer
30b94e8673 Update programming style in extras/references.
extras/references/nb_reference.m:
extras/references/reference.m:
extras/references/scoped_update.m:
extras/references/samples/max_of.m:
extras/references/samples/max_test.m:
     As above.
2022-04-14 20:11:46 +10:00
Julien Fischer
5d0acda798 Delete obsolete predicates from builtin module.
library/builtin:
    Delete the promise_only_solution/1 and promise_only_solution_io/4. Both
    have have been marked as obsolete since 2015.

    Also delete the non-public impure versions of those, get_one_solution/1
    and get_one_solution_io/4. Implementing the pure versions was the only
    use of these.

compiler/hlds_goal.m:
    Delete a reference to promise_only_solution in a comment.

tests/declarative_debugger/trust.exp:
tests/declarative_debugger/trust.inp:
tests/declarative_debugger/trust_1.m:
     Replace a call to promise_only_solution/1; this does simplify this test
     a little, but does not affect what the trust_1 module was testing, namely
     the user-defined comparison on the type exported by that module.

tests/declarative_debugger/exceptions.m:
tests/hard_coded/myset.m:
tests/hard_coded/user_compare.m:
tests/valid_seq/intermod_nested_module_bug2.m:
extras/curs/samples/nibbles.m:
     Replace calls to the now deleted predicates.
2022-04-13 15:09:21 +10:00
Julien Fischer
41aa7cc541 Delete old_term_parser library from extras.
extras/old_term_parser/
     Delete this directory and its contents.

extras/README.md:
     Delete the entry for old_term_parser.

NEWS:
     Announce the deletion.
2022-04-05 17:48:55 +10:00
Julien Fischer
105580a765 Delete the trseg component and --trail-segments option.
Trail segments have been the default in trailing grades since Mercury 20.06.
Delete the trseg grade components and --trail-segment option since apart from
acting as synonyms for the tr component and --use-trail option repsectively,
they no longer do anything.

compiler/compute_grade.m:
compiler/handle_options.m:
compiler/options.m:
doc/user_guide.texi:
grade_lib/grade_vars.m:
scripts/parse_grade_option.sh-subr:
grade_lib/grade_string.m:
grade_lib/grade_vars.m:
   Delete the trseg grade component and --trail-segments option.

compiler/add_pragma.m:
   Update the wording of an error message.

NEWS:
   Announce the above.

extras/trail/Mercury.options:
extras/trailed_update/Mmakefile:
extras/references/Mercury.options:
tests/invalid/test_feature_set.err_exp:
    Conform to the above changes
2022-04-05 17:02:40 +10:00
Julien Fischer
66611dfb0b Fix compilation of extras/xml.
extras/xml/tryit.m:
extras/xml/xml.cat.m:
extras/xml/xml.parse.chars.m:
    Conform to recent library changes.
2022-03-28 20:48:07 +11:00
Julien Fischer
7c0ce24ab4 Avoid calls to obsolete predicates.
extras/java_extras/make_temp.m:
   As above.
2022-03-25 12:40:42 +11:00
Julien Fischer
6f57bd81e7 Fix an issue with moose.
extras/moose/moose.m:
    Emit an import of the string module since the generated code
    contains calls to string.format.

    Omit the import of std_util from the generated code as that is
    no longer required.

extras/moose/samples/cgram.moo:
    We no longer need to import the string module here.

extras/moose/tests/array_based.moo:
    Syntax and formatting cleanup
2022-03-20 20:06:39 +11:00