Re: recursive comments and Re: Techniques for writing an interpreter

Bjarte Mayanja "Østvold" <bjartem@idi.ntnu.no>
24 Mar 1998 22:38:12 -0500

          From comp.compilers

Related articles
[2 earlier articles]
Re: Techniques for writing an interpreter ct7@mitre.org (W. Craig Trader) (1998-03-15)
Re: Techniques for writing an interpreter fjh@cs.mu.OZ.AU (1998-03-15)
Re: Techniques for writing an interpreter hgg9140@heckle.ca.boeing.com (1998-03-18)
recursive comments and Re: Techniques for writing an interpreter monnier+comp/compilers/news/@tequila.cs.yale.edu (Stefan Monnier) (1998-03-20)
Re: recursive comments and Re: Techniques for writing an interpreter sestoft@ellemose.dina.kvl.dk (1998-03-20)
Re: recursive comments and Re: Techniques for writing an interpreter monnier+comp/compilers/news/@tequila.cs.yale.edu (Stefan Monnier) (1998-03-20)
Re: recursive comments and Re: Techniques for writing an interpreter bjartem@idi.ntnu.no (Bjarte MayanjaØstvold) (1998-03-24)
Re: recursive comments and Re: Techniques for writing an interpreter pilz@ifi.unizh.ch (1998-03-24)
Re: recursive comments and Re: Techniques for writing an interpreter sethml@ugcs.caltech.edu (1998-03-24)
| List of all articles for this month |
From: Bjarte Mayanja "Østvold" <bjartem@idi.ntnu.no>
Newsgroups: comp.compilers
Date: 24 Mar 1998 22:38:12 -0500
Organization: Dept. of Computer and Information Science, NTNU
References: 98-03-032 98-03-098 98-03-141 98-03-147 98-03-159 98-03-183
Keywords: syntax

Stefan Monnier <monnier+comp/compilers/news/@tequila.cs.yale.edu> writes:


| What languages allow recursive comments ?


Haskell does:


> {- this {- stuff {- is -} a -} nested comment -}
>
> -- a couple of strings:
> str1 = "-}"
> str2 = "--"


| What languages enforce a "lexing" of the content of comments (so that an
| end-comment inside a string inside a comment is ignored) ?


Haskell does not do this. Commenting out str1 above using {- ... -}
gives a compiler error. Details are in Sec. 2.2 of the Haskell
Report: http://www.haskell.org/onlinereport/lexemes.html


    Bjarte
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.