Author Topic: Nested comments alt second level of comments.  (Read 3917 times)

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Nested comments alt second level of comments.
« on: October 27, 2018, 02:54:12 PM »
As far as I know C2 supports // and /* */ style comments.

I propose a third style of comments that are different from the above. I suggest /+ +/, which is what D uses. Alternatively this commenting style is simply complementing the current ones.

So a few different possible proposals:

1. Allow /* */ to nest

This path is taken by quite a few languages.

2. Introduce a new multi-line comment that is different from /* */ and will ignore any /* */ in the comments.

So:

Code: [Select]
/+
  all is commented */ /* */ /* out here
+/

/*
  all is commented +/ /+ +/ /+ out here
*/

/+ /+  +/ +/  <- parse error.

3. Same as (2) but allow the new comment to nest.

That is this *will* parse:

Code: [Select]
/+ /+  +/ +/

Any of those solutions would be an improvement.