[m-rev.] For review: parsing_utils.m
Ralph Becket
rafe at csse.unimelb.edu.au
Wed Jan 28 18:02:22 AEDT 2009
Julien Fischer, Wednesday, 28 January 2009:
>
> On Wed, 28 Jan 2009, Ralph Becket wrote:
>
> >Add parsing_utils.m to the library, providing support for recursive descent
> >parsers.
> >
> >NEWS:
> > Report the addition of parsing_utils.m to the library.
>
> The NEWS file should also mention the changes to the behaviour of the
> predicates in the string module.
>
> >
> >library/library.m:
> > Include parsing_utils.m.
> >
> >library/parsing_utils.m:
> > Added.
> >
> >library/string.m:
> > Make string.to_int fail on overflow. Amend comments to reflect this.
> >
> >tests/general/Mmakefile:
> >tests/general/test_parsing_utils.exp:
> >tests/general/test_parsing_utils.m:
> > Test case for parsing_utils.m.
>
> ...
>
> >Index: library/library.m
> >===================================================================
> >RCS file: /home/mercury1/repository/mercury/library/library.m,v
> >retrieving revision 1.120
> >diff -u -r1.120 library.m
> >--- library/library.m 9 Mar 2008 09:39:24 -0000 1.120
> >+++ library/library.m 27 Jan 2009 23:44:31 -0000
> >@@ -89,6 +89,7 @@
> >:- import_module ops.
> >:- import_module pair.
> >:- import_module parser.
> >+:- import_module parsing_utils.
> >:- import_module pprint.
> >:- import_module pqueue.
> >:- import_module pretty_printer.
>
> You also need to update mercury_std_library_module/1.
Okay, here's the interdiff. I'll commit now.
diff -u NEWS NEWS
--- NEWS 28 Jan 2009 00:14:17 -0000
+++ NEWS 28 Jan 2009 06:56:15 -0000
@@ -33,6 +33,11 @@
* A new module, parsing_utils, has been added to provide support for
implementing recursive descent parsers.
+* The string.to_int family of predicates now fail (or throw an exception
+ for the det_ versions) if the number being converted is not in the range
+ [int.min_int+1, int.max_int], identifying overflow errors when
+ converting strings to ints.
+
* We have added extra modes to many of the fold style predicates in the
library in order to better support (mostly-)unique accumulators.
diff -u library/library.m library/library.m
--- library/library.m 27 Jan 2009 23:44:31 -0000
+++ library/library.m 28 Jan 2009 06:54:20 -0000
@@ -265,6 +265,7 @@
mercury_std_library_module("pair").
mercury_std_library_module("par_builtin").
mercury_std_library_module("parser").
+mercury_std_library_module("parsing_utils").
mercury_std_library_module("pprint").
mercury_std_library_module("pqueue").
mercury_std_library_module("pretty_printer").
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list