[m-dev.] for review: The .NET MSIL backend.

Tyson Dowd trd at cs.mu.OZ.AU
Tue Oct 10 11:40:36 AEDT 2000


On 09-Oct-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> > > What if CommentStr contains newlines?  If that is not allowed,
> > > it should be documented in the data type definition.
> > 
> > I've changed it to use the `label' feature of pprint.m so you can 
> > have newlines in your comments if you wish.  Also I've fixed this
> > elsewhere.
> 
> Ah, I have a funny feeling that pprint is not embedded-newline
> friendly.  I'll have a look and get back to you; it may be necessary
> to add a new function to pprint that converts "blah\nblah" into
> text("blah") `<|>` text("blah").

That might be nice but it's easy to do:

:- pred output_comment_string(string::in, io__state::di, io__state::uo) is det.
output_comment_string(Comment) -->
        io__write_string("// "),
        { CommentDoc = separated(text, line,
                string__words((pred('\n'::in) is semidet :- true), Comment)) },
        { Doc = label("\t// ", CommentDoc) },
        write(70, Doc).

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list