pikelang / Pike

Pike is a dynamic programming language with a syntax similar to Java and C. It is simple to learn, does not require long compilation passes and has powerful built-in data types allowing simple and really fast data manipulation.
http://pike.lysator.liu.se/
Other
194 stars 34 forks source link

Accept nested block comments: /* a /*nested*/ comment */ #5

Closed mingodad closed 6 years ago

tobij commented 6 years ago

Hi @mingodad,

from the Pike module reference documentation on cpp():

Preprocesses the string data with Pike's builtin ANSI-C look-alike preprocessor.

In ANSI-C, nested multiline comments are not allowed. gcc cpp does not allow them either, and in addition this is a compatibility breaking change, something that Pike is generally very careful with.

We hope you will understand that we will not merge the pull request for these reasons.

BuGlessRB commented 6 years ago

You should use nested #if 0 ... #endif constructs to temporarily disable larger amounts of code, then you will not run into the problem that you'd wish there were nested C-style comments.