elsekeywords fit on the same line with the condition and the
thenkeyword, then the statement is formatted as follows:
if condition then ... elsif condition then ... else ... end if;
When the above layout is not possible,
then should be aligned
if, and conditions should preferably be split before an
or keyword a follows:
if long_condition_that_has_to_be_split and then continued_on_the_next_line then ... end if;
end if always line up with
if keyword. The preferred location for splitting the line
or. The continuation of a condition is
indented with two spaces or as many as needed to make nesting clear.
As an exception, if conditions are closely related either of the
following is allowed:
if x = lakdsjfhlkashfdlkflkdsalkhfsalkdhflkjdsahf or else x = asldkjhalkdsjfhhfd or else x = asdfadsfadsf then ... end if; if x = lakdsjfhlkashfdlkflkdsalkhfsalkdhflkjdsahf or else x = asldkjhalkdsjfhhfd or else x = asdfadsfadsf then ... end if;
or else), except when the operands are boolean variables or boolean constants.
ifstatements are indented two characters:
if this_complex_condition and then that_other_one and then one_last_one then ... end if;
There are some cases where complex conditionals can be laid out in manners that do not follow these rules to preserve better parallelism between branches, e.g.
if xyz.abc (gef) = 'c' or else xyz.abc (gef) = 'x' then ... end if;
ifblock is preceded and followed by a blank line, except where it begins or ends a sequence_of_statements.
A := 5; if A = 5 then null; end if; A := 6;
casestatements, the extra indentation can be saved by aligning the
whenclauses with the opening
case expression is when condition => ... when condition => ... end case;
whileon one line with the condition and the
for J in S'Range loop ... end loop;
while long_condition_that_has_to_be_split and then continued_on_the_next_line loop ... end loop;
If the loop_statement has an identifier, it is laid out as follows:
Outer : while not condition loop ... end Outer;