-
Notifications
You must be signed in to change notification settings - Fork 865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: actual block comments #1050
Comments
I think that would be a bad idea, since it would mean that a tiny token like Compare programming languages like Java or C, where multi-line comments are almost always written like this: /*
* This is a multi-line
* comment.
*/ So people voluntary add a comment-marking character to each line, though syntactically that would not be required. With Also, a built-in syntax for multi-line comments doesn't seem to be missed in languages like Python. |
For the use case where something is a comment and is meant to stay a comment, that's fine. However when you have whole sections of a config that need to be disabled / re-enabled quickly and easily it doesn't hold up. An end user doesn't typically have an editor with convenient multi-line editing or convert selected region to comment functionality, they typically have something like Notepad or Wordpad. As for Python not having multi-line comments, that's one of many things I personally don't like about Python and is enough of a problem that a common solution is to just use unassigned multi-line string literals in place of multi-line comments. I'll admit that I can kind of see the argument that a small token causing much of a file to be ignored could be unintuitive, so perhaps a longer token would be a better alternative such as in XML, as a bonus it's a commonly used comment syntax.
|
Would it be possible to add new syntax for block comments to a future version?
I've started using TOML as a configuration file in one of my own projects and am so far quite happy with its capabilities, however I have run into one friction point, the lack of a proper way to temporarily comment out a large continuous swath of the config natively. Sure I can use Notepad++ multi-line editing or whatever current IDE equivalent there is, but if an end user ever has to do that and comment out a bunch, they almost certainly won't have that luxury.
I'm not sure what would work for the syntax itself since it ideally wouldn't break backwards compatibility, that means it probably can't start with '#'. About the only thing that doesn't conflict with any existing syntax are angle brackets and parentheses so maybe something like:
With the inclusion of the '#' to better associate the syntax with normal comments maybe?
The text was updated successfully, but these errors were encountered: