The last element in a clause is the semicolon delimiter. The language processor implies
the semicolon: at a line-end, after certain keywords, and after a
colon if it follows a single symbol. This means that you need to include
semicolons only when there is more than one clause on a line or to
end an instruction whose last character is a comma.
A line-end usually marks the end of a clause and, thus, REXX implies
a semicolon at most end of lines. However, there are the following
exceptions:
- The line ends in the middle of a string.
- The line ends in the middle of a comment. The clause continues
on to the next line.
- The last token was the continuation character (a comma) and the
line does not end in the middle of a comment. (Note that a comment
is not a token.)
REXX automatically implies semicolons after colons (when following
a single symbol, a label) and after certain keywords when they are
in the correct context. The keywords that have this effect are:
ELSE, OTHERWISE, and THEN. These special cases reduce typographical
errors significantly.
Note: The two characters forming the comment delimiters, /* and */, must not be split by a line-end (that is, / and * should not appear on different lines) because
they could not then be recognized correctly; an implied semicolon
would be added. The two consecutive characters forming a literal quotation
mark within a string are also subject to this line-end ruling.