Commit 92f60e5c7 inadvertently changed the conjunction operator recognised by
this program from "," to ", ". Fix that.
samples/interpreter.m:
tests/debugger/interpreter.m:
As above.
samples/c_interface/standalone_c/Makefile:
Fix grammar in a couple of spots.
Use ':=' in place of '=' in some assignments.
samples/c_interface/standalone_c/c_main.c:
Fix grammar in a couple of spots.
Do not say that access to Mercury mutables from C is currently
not thread safe; it will never be thread without the programmer
putting in their own synchronization.
Put .mh files into a Mercury/mhs subdirectory when --use-subdirs
or --use-grade-subdirs is used.
compiler/file_names.m:
Replace ext_cur_mh with ext_cur_ngs_max_cur_mh, in the new category
ext_cur_ngs_max_cur. The new category is similar to that for .mih
files, except that .mh files are never placed in grade-specific
subdirectories.
compiler/handle_options.m:
Add Mercury/mhs subdirs to list of C include directories
when --use-subdirs or --use-grade-subdirs is in effect.
compiler/write_deps_file.m:
Add $(mhs_subdir) prefix before %.mh patterns.
Create a Mercury/mhs -> .. symlink when installing.
This is required by mmc --make and mmake --use-subdirs.
Conform to the changes above.
compiler/export.m:
compiler/make.file_names.m:
compiler/make.program_target.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mlds_to_c_file.m:
Conform to the changes above.
scripts/Mmake.vars.in:
Define the variable mhs_subdir.
scripts/Mmake.rules:
Add -I option to find .mh files when --use-subdirs is used.
browser/.mgnuc_copts:
browser/MDB_FLAGS.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/DEEP_FLAGS.in:
extras/EXTRAS_FLAGS.in:
grade_lib/.mgnuc_copts:
grade_lib/GRADE_LIB_FLAGS.in:
library/.mgnuc_copts:
mdbcomp/.mgnuc_copts:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/.mgnuc_copts:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/.mgnuc_copts:
profiler/PROF_FLAGS.in:
slice/.mgnuc_copts:
slice/SLICE_FLAGS.in:
ssdb/.mgnuc_copts:
ssdb/SSDB_FLAGS.in:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
trace/.mgnuc_copts:
tools/lmc.in:
Add -I options to find .mh files when the workspace is built
with mmake --use-subdirs.
samples/c_interface/standalone_c/Makefile:
Add option to let the C compiler find the .mh file.
NEWS.md:
Announce change.
Delete trailing whitespace.
samples/diff/globals.m:
Replace the use of the deprecated I/O globals with a mutable.
Delete unnecessary module qualification.
samples/diff/*.m:
Update copyright notices.
profiler/options.m:
Use io.write_prefixed_lines for writing the usage message.
Add -? as a synonym for --help.
samples/diff/options.m:
samples/mcowsay.m:
Use io.write_prefixed_lines for writing the usage messages.
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.
samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
As above.
samples/c_interface/*:
Replace left over references to the old c_header_code pragma.
Replace some uses of '__' as a module qualifier.
Replace tabs with spaces.
Add some missing words.
library/ops.m:
Instead of an op_table mapping a string to a list of one or more op_infos,
make it map the string to a single structure, the op_infos, which has
four slots, one each for infix, binary prefix, prefix and postfix
op information. This allows parsers and unparsers to go directly to
the kind of operator (e.g. infix or prefix) that they are interested in.
NEWS:
Announce the change.
compiler/parse_tree_out_term.m:
library/mercury_term_parser.m:
library/pretty_printer.m:
library/stream.string_writer.m:
library/string.to_string.m:
samples/calculator2.m:
tests/hard_coded/bug383.m:
Conform to the change. In several places, the new operator representation
allows the replacement of loops with direct lookups, and the replacement
of if-then-else chains with switches.
Add reminders about keeping two predicates in sync.
library/io.m:
Delete the set_io_table predicate, which did nothing and was never
called from anywhere, and the get_io_table predicate, which always
returned the same op_table. They were in io.m's interface, but in the
not-publicly-visible part of the interface.
library/ops.m:
Rename the lookup_op method to is_op.
Delete references to the predicates deleted from io.m.
NEWS:
Announce the lookup_op->is_op rename.
compiler/parse_tree_out_term.m:
library/mercury_term_parser.m:
library/string.to_string.m:
library/term_io.m:
samples/calculator2.m:
tests/hard_coded/bug383.m:
Conform to the lookup_op->is_op rename.
Replace calls to get_io_table with code that directly gets
the Mercury op table.
In parse_tree_out_term.m, call the predicates operating on the
Mercury op table directly, not through the op_table type class.
In mercury_term_parser.m, update some comments.
In term_io.m, use OpTable to refer to op_tables.
tests/hard_coded/stdlib_init.{m,exp}:
Don't test get_io_table.
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.
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.
samples/mcowsay.m:
A Mercury version of the cowsay program. It serves an more extended
example (but still small) example of how to write command line
utilities in Mercury.
samples/README.md:
Include the new sample.
samples/Mmakefile:
Include the new sample.
Put the list of sample programs in alphabetical order.
samples/c_interface/mercury_calls_fortran/Mmakefile:
g77 was replaced by gfortran in GCC 4.0, use the latter in
this example.
samples/c_interface/mercury_calls_fortran/fortran_main_int.m:
Replace a ':- pragma import' with an equivalent foreign_proc.
Describe the current gfortran name mangling scheme and delete
references to g77 command line options not supported by gfortran.
samples/c_interface/mercury_calls_fortran/mercury_main.m:
Replace tabs with spaces.
tests/general/interpreter.{m,inp,exp}:
tests/general/Mmakefile:
As above: delete this test case.
samples/interpreter.m:
Delete reference to the deleted test case.
tests/debugger/interpreter.m:
Delete reference to the deleted test case in this copy of
samples/interpreter.m.
tests/debugger/interpreter.exp:
tests/debugger/interpreter.exp2:
The last update of interpreter.exp was in 2003. The command we invoke
this test case with has changed several times since then, but none
of them have been reflected in interpreter.exp, so now there is no way
for it to be matched. This diff deletes interpreter.exp, and renames
the old interpreter.exp2 to become the new interpreter.exp.
tests/general/arithmetic.nl:
tests/general/interpreter.nl:
tests/general/string_test.nl:
Delete these relics of the time when we compared output generated
by Mercury to output generated by NU-Prolog, since NU-Prolog is long dead.
tests/general/arithmetic.m:
tests/general/string_test.m:
Update programming style, and factor out common code.
samples/interpreter.m:
Make this the primary copy of interpreter.m. Incorporate the improvements
from the other two versions in tests, and generalize them to be suitable
as a sample program.
tests/debugger/interpreter.m:
tests/general/interpreter.m:
Make these copies of the primary version.
tests/debugger/Mmakefile:
tests/general/Mmakefile:
Keep the tests copies of the primary version.
tests/general/interpreter.exp:
Expect an output now generated for parameter-less invocations.
samples/java_interface/short_example.m:
A Java version of the short example.
samples/java_interface/README.md:
Add an entry for the new example.
samples/c_interface/README.md:
samples/csharp_interface/README.md:
Fix wording.
samples/csharp_interface/README.md:
Add a README file for this subdirectory.
samples/java_interface/README:
Rename this file to README.md; convert its contents
to Markdown.