Commenting Styles and Syntax
There are three ways to indicate a comment in Alloy:
- To comment out several lines of text, place "/*"
before the text and "*/" after the text. All
intervening text (including linebreaks and whitepace) will be
ingored. Some users follow the convention of putting a
* in front of each line in the comment, but this
is not necessary.
- A single line can be commented by placing "//" at
the beginning of the comment. All text (including whitespace)
after the slashes and before the the next linebreak will be
ignored.
- A single line can also be commented by placing
"--" at the beginning of the comment. All text
(including whitespace) after the dashes and before the the next
linebreak will be ignored.
For example, in the following text, the c's are
commented text, and the A's are uncommented Alloy
code:
AA AA AAAAA AA AA
AAAAA
//cccccccc
AAAA AA AA AAA AA --cccccccc
/* cc cccccc
ccccccc
ccccc */
AA AAA AAA AAAAA
AAAAAA AA AA /* c cc cccc */ AA AAAA /*ccc*/ AAA A AAAA
/*
* ccc c ccc cc ccccc
* ccccccc cccccc-ccc
*/
AAAAAA
-- cccccc
--ccccc
AAAAAAA A AA A
// ccccc
//ccccc
AAA AAAA AA A A A