Documentation comments MAY be added to many RAPID-ML™ language elements, and code comments MAY be added anywhere in the code. Documentation comments may span multiple lines. Code comments have two forms: single-line and multi-line.
/** <comment> */
Single-line Code Comments
Multi-line Code Comments
/* <comment> */
/** This is a documentation comment for the TaxBlaster rapidModel element. */
/** This is a documentation comment for the InterfaceModel resourceAPI element. */
resourceAPI InterfaceModel baseURI "http://localhost:8080" // This is a single-line code comment inserted at the end of a line.
/** This is a documentation comment for the DataModel dataModel element. */
// This is a single-line code comment, which can be inserted *anywhere*.
/* This is a multi-line
/** This is a documentation comment
id : string
A free text description of an element or some aspect of the code.
Documentation for Model Elements
Documentation comments MAY precede all of the elements listed below:
Whitespace Normalization in Documentation Comments
Within a documentation comment, whitespace is normalized as follows:
|•||A whitespace sequence containing zero or more spaces and/or tabs, and containing a single line break anywhere in the sequence, is normalized to a single space.|
|•||A whitespace sequence containing zero or more spaces and/or tabs, and containing two line breaks anywhere in the sequence, is normalized to a sequence of two line breaks, resulting in a blank line between the preceding and following non-whitespace character sequences.|
Conformant editors and parsers MUST apply these whitespace normalization rules.
Documentation as Model Properties
Model elements allowing documentation comments treat the whitespace-normalized documentation content as an element property. Conformant parsers SHOULD preserve the whitespace-normalized documentation in the abstract syntax tree or other intermediate and output representations.
Code comments are not part of the model, and are not expected to be preserved as model element properties Conformant parsers MAY safely ignore or discard code comments.