Comments
Lexer:
SINGLE_LINE_COMMENT :;
~EOL* EOLMULTI_LINE_COMMENT :
;/
~/;
*/;
DOCUMENTATION_COMMENT :
{
~}
*}
There are three types of comments:
Single-line Comments
These comments start with a ;
and end at the Line Ending. Anything within the comments will be ignored by the compiler.
; this is a comment
int x = 0 ; this is also a comment
int y = 0; this is also valid
Multi-line Comments
Multi-line comments start with a ;/
and end at a /;
. These comments swallow line endings.
;/
this
can
go
across
multiple
lines
/;
int x = 0;/ it can even
start here
/;
Documentation Comments
These comments can only appear after one of the following concepts and will be visible in the editor.
Fallout 4 added Documentation Comments to more concepts:
Between a concept and a Documentation Comment can be any amount of whitespace and empty lines. Because Single-line and Multi-line Comments are ignored the following code is valid.
ScriptName MyScript
; Single-line comments are skipped
;/
so are Multi-line Comments
/;
{Documentation Comments can appear
after any amount of empty lines.}