CPP: Add syntax examples to QLDoc in various files#1770
CPP: Add syntax examples to QLDoc in various files#1770zlaski-semmle merged 7 commits intogithub:masterfrom
Conversation
| * // C++ style single-line comment | ||
| * ``` | ||
| * or a C style comment (which starts with `/*`). | ||
| */ |
There was a problem hiding this comment.
I believe that C99 also allows single-line comments. Also, why not just say
/* C style comment */
right after// C++ style single-line comment
?
There was a problem hiding this comment.
Yes, modern C allows C++-style comments, but they're still understood to be C++ style.
Regarding /* C style comment */, that's what I wanted to write but it is sadly impossible to put that in the QLDoc comment cleanly without the */ closing the QLDoc comment itself and causing problems. Hence the irregularity.
There was a problem hiding this comment.
Have you tried escaping the asterisk, i.e., \*/ ? Markdown languages appear to support it.
There was a problem hiding this comment.
*/ has been suggested, the trouble is that I suspect QLDoc is read plaintext as frequently as it is read in rendered form. After all a /** QLDoc comment is also a /* code comment. So I'm reluctant to add strange encodings that aren't readable in plaintext form (\*/ would have been better but it doesn't seem to work).
zlaski-semmle
left a comment
There was a problem hiding this comment.
Apart from my nit about comments, this LGTM.
zlaski-semmle
left a comment
There was a problem hiding this comment.
Too bad about the comments...
A number of straightforward cases here.
For https://jira.semmle.com/browse/CPP-407.