[m-rev.] Change compiler output to use `.' as module separator

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 6 02:45:28 AEDT 2003


On 03-Jan-2003, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Fergus Henderson, Thursday, 19 December 2002:
> > 
> > I think that will do the wrong thing for terms such as '.'(1,2).
> > Note that term_io is used for parsing Prolog code, not just Mercury code...
> 
> Okay, here's the fix:
> 
> Index: library/term_io.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/library/term_io.m,v
> retrieving revision 1.65
> diff -u -r1.65 term_io.m
> --- library/term_io.m	30 May 2002 04:39:48 -0000	1.65
> +++ library/term_io.m	2 Jan 2003 00:49:53 -0000
> @@ -346,6 +346,19 @@
>  				VarSet0, N0, VarSet1, N1),
>  		( { OpName = "," } ->
>  			io__write_string(", ")
> +		; { OpName = "." } ->
> +				% If the operator is '.'/2 then we must
> +				% not put spaces around it (or at the
> +				% very least, we should not put spaces
> +				% afterwards which would make it appear
> +				% as the end-of-term token.)  However,
> +				% we do have to quote it if the right
> +				% hand side can begin with a digit.
> +				%
> +			io__write_string(
> +				if starts_with_digit(Arg2) then "'.'"
> +							   else  "."
> +			)


What about if the LHS ends with a digit?
e.g. consider "'.'(3,e9)".  That should be output as "3'.'e1",
not "3.e9".

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list