Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there such a thing as a comment in IL?

I realize nobody just sits down and develops software in straight IL (do they?). But suppose you want to share a snippet of IL code (as output by, e.g., the C# compiler) with someone else for discussion, and furthermore you want to annotate it with a few comments. Is there an actual syntax for comments in IL so that you could do this without making the text invalid as IL? Not really a big deal, just curious.

like image 720
Dan Tao Avatar asked Jan 07 '11 19:01

Dan Tao


2 Answers

Yes, you can use // and /* ... */ just like in C#.

I can't find any reference to it in ECMA-335, but this IL guide includes:

The first two lines (started with //) are the comments. In ILAsm, you can comment in the same way as that in C# or C++. To comment multiple lines or the part of line, you can also use /* ... */ block as well.

like image 114
Jon Skeet Avatar answered Oct 15 '22 11:10

Jon Skeet


you use // in IL for comments as well...

like image 38
Dani Avatar answered Oct 15 '22 12:10

Dani