Configuring Subprogram Specification Statement Rules
There are rules which will check indent and formatting of the subprogram specification of a procedure
or function
:
subprogram_specification ::=
procedure designator [ ( formal_parameter_list ) ]
| [ pure | impure ] function designator [ ( formal_parameter_list ) ]
return type_mark
designator ::= identifier | operator_symbol
formal_parameter_list ::= parameter_interface_list
interface_list ::=
interface_element { ; interface_element }
interface_element ::= interface_declaration
There are separate rules for the structure of the subprogram specification and the indenting. Both rules are required to ensure proper formatting of subprogram specification statements.
There are several options to the structure rules:
Option |
Symbol |
Values |
Structural Element |
Default Value |
Description |
---|---|---|---|---|---|
|
|
opening parenthesis |
|
|
|
|
|
closing parenthesis |
|
||
|
|
interface element |
|
||
|
|
semicolon |
|
||
|
N/A |
|
N/A |
|
|
The following figure illustrates where the options will be applied in an procedure call.
The following configuration replicates the above code snippet.
rule :
procedure_013:
first_open_paren : 'remove_new_line'
last_close_paren : 'add_new_line'
interface_element_semicolon : 'remove_new_line'
interface_element: 'add_new_line'
ignore_single_line : 'no'
Note
All examples use the above configuration.
Example: first_open_paren
set to add_new_line
Setting the first_open_paren
option to add_new_line
will result in the following formatting:
procedure update_test
(
test_number : integer;
test_result : boolean
);
Example: last_close_paren
set to remove_new_line
Setting the last_close_paren
option to remove_new_line
will result in the following formatting:
procedure update_test (
test_number : integer;
test_result : boolean);
Example: interface_element
set to remove_new_line
Setting the interface_element
option to remove_new_line
will result in the following formatting:
procedure update_test (test_number : integer;test_result : boolean
);