Task

Show all ways to include text in a language source file
that's completely ignored by the compiler or interpreter.



Related tasks

   Documentation
   Here_document


See also

   Wikipedia
   xkcd (Humor: hand gesture denoting // for "commenting out" people.)


#!/usr/bin/env/jsish
/* Comments, in Jsish */
 
// to end of line comment, double slash
 
/*
 Enclosed comment, slash star, ending with star slash
 Cannot be nested, but can cross line boundaries and occur
 pretty much anywhere whitespace is allowed
*/
 
var x = 'X'; /* A var called X */
/* active code on this line */ printf("Result %q %d\n", /* comment code mix */ x, /**/42);
 
;x;
// jsish also handles double slash commented
// unit test echo lines as a special case of "expect failure"
 
;//noname(x);
 
/*
=!EXPECTSTART!=
Result X 42
x ==> X
noname(x) ==>
PASS!: err = can not execute expression: 'noname' not a function
=!EXPECTEND!=
*/