Questions tagged [comments]

For questions relating to comments or other syntactic language elements that are ignored by the compiler

Filter by
Sorted by
Tagged with
-1 votes
2 answers
191 views

Why hasn't html a simple way of showing html tags as they are? [closed]

html comments meant to be read by the person reading the source are like <!-- Write your comments here --> But sometimes we want to depict a html as it is, ...
Quora Feans's user avatar
12 votes
3 answers
622 views

Preserving Comments in AST

I'm currently working on a protobuf parser and I'm trying to preserve the comments in the AST. However, there many non-trivial cases and I was wondering if there was an already existing algorithm/data ...
Clément Jean's user avatar
7 votes
7 answers
1k views

Pros and cons of whitespace or comments being included as tokens

What are the pros and cons of including whitespace and comments as tokens in the tokenizer output? For example: value= 6+ 7 // A comment Would result in these ...
MarcellPerger's user avatar
7 votes
4 answers
157 views

Enforcing doc comments in the compiler, good idea or not?

Most languages have a way of writing doc comments. Doc comments above a function, class, or struct provide a strucutred way to describe every part of the function, like this: ...
mousetail's user avatar
  • 8,111
3 votes
14 answers
1k views

What are common options for comment syntax?

Almost all languages have comments, but the syntax for comments can vary wildly between them. What are commonly used options for comment syntax, and what are their advantages and disadvantages?
Ginger's user avatar
  • 2,579