On 30/10/14 19:45, Brian Drummond wrote:
> On Thu, 2014-10-30 at 08:46 +0100, [email protected] wrote:
> My only problem with block comments is that the C implementation gets
> them spectacularly wrong.
>
> In Modula-2 you count up the start /* (ok, (* )  markers and count down
> the end */ markers. 
>
> Only when the count is 0 do you parse anything else.
>
> This means that commenting out a chunk of code actually does what you
> want, even if that chunk of code is commented! 
>
> Unfortunately VHDL-2008 follows C in that respect. I wonder if it's
> worth suggesting an enhancement to fix that?
>
> - Brian
Yes, I remember listening to this argument before. I think it's worth
suggesting a fix as you proposed.
It shouldn't affect existing designs that do not have nested comments,
such as the ones I have written. Perhaps for a start, GHDL could support
block comments assuming there's only one opening /* and one closing */,
that is, assume there are no nested comments. While we wait to see if
there's a general consensus to fix block comments to follow Modula-2.

-daniel

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to