comments

Visual Studio C++ Multiline comments

◇◆丶佛笑我妖孽 提交于 2020-01-01 02:59:04
问题 In VS C++ code, if i haven't selected anything or full line selected and press comment selection (Ctrl+K + Ctrl+C) then it will comment the whole line with // int x = 5; After Pressing Ctrl+K + Ctrl+C without anything selected or full line selected. // int x = 5; Now if I select some part of the line and press comments button again only selected text will be commented (bold means selected) int x = 5 ; After Pressing Ctrl+K + Ctrl+C with x = 5 selected. int /*x = 5*/; Incase of multiple lines

How to extract comments and match to declaration with RecursiveASTVisitor in libclang c++?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 02:17:07
问题 I am writing a utility which is supposed to parse C++ (and C) header files, extract the structs, enums, fields etc. and generate code in other languages based on the extracted information. I decided to use libclang for this. I'm using a RecursiveASTVisitor and it seems I'm able to extract all the information I need, except for comments. I want to have the comment which appears right above every declaration (field, struct, class, enum) read, and add its text when I generate the code in other

Are there standard formats for comments within code?

╄→гoц情女王★ 提交于 2019-12-31 10:58:11
问题 I'm wondering if people have a standard format for comments in their code. Not things like xml comments for a method or class but rather comments within a method. See also: Is there a standard (like phpdoc or python’s docstring) for commenting C# code? 回答1: You should really consider a couple things to make good comments beyond formatting. Do not simply restate what the code is doing. For example, // Start the services StartServices(); is a frigging terrible comment! Describe why . Why is the

vimrc make comments italic

浪尽此生 提交于 2019-12-31 10:01:10
问题 How do I change the ~/.vimrc to have the comments in my code italicized? In my ~/.vimrc file I have: highlight Comment ctermfg=blue that makes the comments blue. What do I need to do differently to make them italic? 回答1: highlight Comment cterm=italic gui=italic You'll need a font with an italic set and a terminal capable of displaying italics. Also, if you're using a color scheme other than the default, the above line should come after the color scheme is loaded in your ~/.vimrc so that the

How do I remove ONLY JavaScript comments that start with “// ”?

寵の児 提交于 2019-12-31 04:38:07
问题 To clarify first, I already have a compression tool that successfully compresses EVERYTHING else so I don't need a long complicated preg_replace regex, just a simple preg_replace or str_replace rule will do. I ONLY want to remove JavaScript comments that start with "// " (including the space so I don't erase URLs) up until the new line. THAT'S IT! Once again, I don't need to replace /* */ or any other variations as I have a script that does that already; the only thing it's missing is this

How do I remove ONLY JavaScript comments that start with “// ”?

╄→尐↘猪︶ㄣ 提交于 2019-12-31 04:38:01
问题 To clarify first, I already have a compression tool that successfully compresses EVERYTHING else so I don't need a long complicated preg_replace regex, just a simple preg_replace or str_replace rule will do. I ONLY want to remove JavaScript comments that start with "// " (including the space so I don't erase URLs) up until the new line. THAT'S IT! Once again, I don't need to replace /* */ or any other variations as I have a script that does that already; the only thing it's missing is this

Facebook social plugin comments after URL change

南楼画角 提交于 2019-12-30 11:13:10
问题 Just a simple question, I had facebook comments integrated in my page here: http://www.bbcnepalidrama.com/main/node/3 Now I have changed the URL alias like this: http://www.bbcnepalidrama.com/main/about I have also set a 301 redirect in the old URL which redirects to the new one. The Question is how do I get the old comments in this URL? They are missing now. 回答1: I think, that these comments will be forever associated with that URL and since you've changed it, as far as FB is concerned you

Are Python docstrings and comments stored in memory when a module is loaded?

℡╲_俬逩灬. 提交于 2019-12-30 08:12:26
问题 Are Python docstrings and comments stored in memory when a module is loaded? I've wondered if this is true, because I usually document my code well; may this affect memory usage? Usually every Python object has a __doc__ method. Are those docstrings read from the file, or processed otherwise? I've done searches here in the forums, Google and Mailing-Lists, but I haven't found any relevant information. Do you know better? 回答1: By default, docstrings are present in the .pyc bytecode file, and

Are Python docstrings and comments stored in memory when a module is loaded?

半世苍凉 提交于 2019-12-30 08:11:27
问题 Are Python docstrings and comments stored in memory when a module is loaded? I've wondered if this is true, because I usually document my code well; may this affect memory usage? Usually every Python object has a __doc__ method. Are those docstrings read from the file, or processed otherwise? I've done searches here in the forums, Google and Mailing-Lists, but I haven't found any relevant information. Do you know better? 回答1: By default, docstrings are present in the .pyc bytecode file, and

Easy way to convert python source code to an AST with comments intact

爷,独闯天下 提交于 2019-12-30 06:18:09
问题 I have done fair bit of searching around how to capture python ASTs with comments preserved. The suggested way includes using ast and tokenize libraries to get the job done. I have had fair bit of success in utilizing these libraries as per my requirement but I feel there has to be a better way. This thought stems from the fact that lib2to3 converts python2 code to python3 code with comments preserved. Also the process is stated to be Source-Code-in-Python2 -> AST -> Source-Code-in-Python3