Estimated hours taken: 0.1
Allow prolog version of the compiler to be built.
library/string.nu.nl:
Add missing definition of string__from_rev_char_list
Estimated hours taken: 24
Add code to parse terms from strings rather than from streams.
The original intention for this change was twofold:
to increase expressiveness and to improve efficiency.
However, for the moment I have given up on the goal of
improving efficiency.
library/io.m:
Add io__read_file_as_string/{4,5}, for efficiently
reading a whole file into a single string.
Add io__read_from_string/5, for reading terms of
any type from a string.
(Should that instead be named string__read instead?)
library/string.m:
Implement string__substring/4 more efficiently,
using `pragma c_code' rather than by calling
string__right(string__left(...)).
Export string__unsafe_index/3, and add new exported
predicate string__unsafe_substring/4 -- these
are versions of string__index and string__substring
that don't check for range errors. They are
needed to get reasonable efficiency when dealing
with very large strings.
library/string.nu.nl:
Add Prolog implementations of string__substring
and string__unsafe_substring.
library/lexer.m:
Add lexer__string_get_token_list/{5,6}, for parsing
tokens from a string. This required adding
`string_' versions of most of the lexical analysis routines.
XXX lots of code duplication, I'm afraid.
XXX the string versions are not as efficiency as they
could ideally be.
library/parser.m:
Add new predicates parser__read_term_from_string/{4,6}
and parser__parse_token_list.
compiler/bytecode_gen.m:
compiler/error_util.m:
compiler/fact_table.m:
compiler/term_errors.m:
Minor changes to use term__context as an ADT rather than
as a concrete data type.
In addition, I made the following changes, which I am NOT committing.
compiler/prog_io.m:
Change to use io__read_file_as_string and
parser__read_term_from_string.
(Not committed because the existing method is
in currently more efficient.)
library/term.m:
Add new alternative term__detailed_context to the term__context type.
This alternative can record both the start and end of a term rather
than just the end.
(The lexer now has almost all the necessary support for detailed
contexts, but enabling it would have some potentially significant
efficiency costs, and curently the parser uses only single contexts
rather than ranges; so currently this is not used.)
Estimated hours taken: 0.1
library/string.nu.nl:
add string__unsafe_index. I thought I approved a diff from
fjh, but then again, maybe I only thought I did....
Estimated hours taken: 0.25
library/string.nu.nl:
Add a Prolog definition for string__unsafe_index/3, which
is defined using `pragma c_code' in string.m.
Estimated hours taken: 0.25
library/string.nu.nl:
Implement string__float_to_f_string in NU-Prolog. (The C
implementation version of this predicate was recently added by
petdr; it also needs an NU-Prolog implementation.)
compiler/*
Allow predicate and mode definitions, and predicate calls to have
module qualifiers. This allows a restricted form of predicate
name overloading.
compiler/llds.m, prog_io.m
In addition to above, these modules now write some labels in `*.c'
output files with module-name qualifiers. Predicate `main/2',
predicates of `mercury_builtin' and special predicates with names
like `__*__' are not qualified.
compiler/mercury_to_goedel.m
This module is probably a little more broken than before, as
module:qualifiers are ignored.
library/char.*, *
Change some predicate names from `char_*' to `char__*' for better
consistency, nicer `c' labels.
library/*, compiler/*
Change calls to predicates `char_*' to `char__*'.
string.m, string.nu.nl:
Move the definitions of string__length/2, string__index/2, and
string__append/3 from string.m into string.nu.nl, since for
Mercury they are now implemented in runtime/io.mod.
library/string.nu.nl:
Use a more elegant implementation of string__float_to_string,
as suggested by Jeff Schultz.
library/string.m:
Fix typo in comment.
library/string.nu.nl:
In `string__to_float', handle strings that don't contain
a decimal point. (The implementation technique of calling
`sread' still sucks. NU-Prolog doesn't seem to have any
easy way of doing this.)
code_util.nl, float.nl, llds.nl, mercury_builtin.nl, opt_debug.nl,
parser.nl, polymorphism.nl, sp_lib.nl, string.nl, string.nu.nl,
type_util.nl, typecheck.nl, unify_gen.nl:
Implement floating point.
Makefile.common:
Remove `-include test.dep' line. Use Mmake.
int.nl:
Update a few of the comments.
io.nu.nl:
For Sicstus Prolog, if main/2 is not defined then enter the
debugger.
Makefile.common:
Various minor bugfixes.
Makefile.mercury:
Add rules for creating assembler (.s) files.
term.nl, *.nl:
Replace term__context_init/1 with term__context_init/0.
The first argument was always zero anyway.
io.nl:
Change the interface to io__read_char and io__read_line so that
they return a better error indicator.
Add a new predicate io__putback_char.
polymorphism.nl:
Don't abort if a predicate doesn't have any modes.
options.nl:
Let's try turning polymorphism on again. It seems to work this time.
string.nl, string.nu.nl:
Add string__to_float.
Move implementation of string__to_int from string.nl to string.nu.nl.
hlds.nl, hlds_out.nl, det_analysis.nl:
Remove the unused `declared_determinsm' field in the goal_info.
Rename the `inferred_determinism' field as just `determism'.
Add a new field `local_determinism'. In det_analysis.nl,
Plug the contents of the new `local_determinsm' field in the goal_info
into the computation of the determinism for each goal.
det_analysis.nl, fix_errs.sed:
For the cases which we currently don't handle correctly,
generate incorrect code in preference to generating spurious
error messages (we still have to handle these cases sometime,
but this means that we can deal with them one at a time).
arg_info.nl, builtins.nl, code_gen.nl, delay_info.nl, det_analysis.nl,
getopt.nl, globals.nl, make_hlds.nl, modes.nl, mode_util.nl, stack.nl,
string.nl, string.nu.nl, term.nl, undef_modes.nl, varset.nl:
Fix determinism errors uncovered by the changes in the determinism
analysis.
string.nl, string.nu.nl, Makefile, doit.nl:
Isolate the assumption that strings are just lists
of integers into a new file string.nu.nl, so that
string.nl will type-check properly.
int.nl: bug fix.
hlds.nl: add predicate `predinfo_context'.
hlds_out.nl: lots of misc. changes to get it past the type-checker.
typecheck.nl: improve the error messages a little.
varset.nl: bug fix.