[m-rev.] for review: tuple syntax fix

Simon Taylor stayl at cs.mu.OZ.AU
Fri Mar 8 17:13:10 AEDT 2002


On 08-Mar-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Estimated hours taken: 1
> Branches: main
> 
> library/parser.m:
> 	Change the parsing for tuples to be similar to the parsing
> 	for functor arguments, so that e.g. "{(x,y)}" parses as
> 	"'{}'(','(x,y))" rather than as "'{}'(x,y)", and "{ x :- y }"
> 	parses successfully as is, rather than needing to be rewritten as
> 	"{ (x :- y) }".

Test case?

> Index: library/parser.m
> ===================================================================
> +parser__parse_tuple_args(List) -->
> +	parser__parse_arg(Arg0),
> +	(   { Arg0 = ok(Arg) },
> +	    ( parser__get_token(Token, Context) ->
> +		( { Token = comma } ->
> +		    parser__parse_tuple_args(Tail0),
> +		    ( { Tail0 = ok(Tail) } ->
> +			{ List = ok([Arg|Tail]) }
> +		    ;
> +			% propagate error upwards
> +		        { List = Tail0 }
> +		    )
> +		; { Token = close } ->
> +		    { List = ok([Arg]) }

Shouldn't that be `close_curly'?

Simon.
--------------------------------------------------------------------------
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