whitespace_options_t Derived Type

type, public :: whitespace_options_t

Modes of the whitespace rules. The defaults follow the most common style in practice where it is clear-cut, and keep the rest.


Inherited by

type~~whitespace_options_t~~InheritedByGraph type~whitespace_options_t whitespace_options_t type~format_options_t format_options_t type~format_options_t->type~whitespace_options_t spaces

Components

Type Visibility Attributes Name Initial
integer, public :: assignment = WS_ADD

= outside brackets: assignments, initializations, do i = 1, n

integer, public :: comma = WS_KEEP

,: with WS_ADD, no blank before and at least one after

integer, public :: concat = WS_REMOVE

//

integer, public :: conditional = WS_ADD

? and : of a conditional expression (c ? a : b) (F2023)

integer, public :: control_paren = WS_ADD

between if, while, select case, where, ... and (, and between ) and a final then

integer, public :: declarations = WS_ADD

::

integer, public :: defined_operators = WS_KEEP

binary user-defined operators: a .plus. b

integer, public :: keyword_args = WS_REMOVE

= inside brackets: f(x=1), intent=, len=*

integer, public :: logical = WS_KEEP

.and. .or. .eqv. .neqv.

integer, public :: mult_div = WS_KEEP

binary * /

integer, public :: percent = WS_REMOVE

%

integer, public :: plus_minus = WS_KEEP

binary + -

integer, public :: pointer = WS_ADD

=>: pointer assignment, renames, associate

integer, public :: power = WS_REMOVE

**

integer, public :: relational = WS_KEEP

== /= < <= > >= and .eq. etc.

integer, public :: slice_colon = WS_REMOVE

: inside brackets: a(1:n)


Source Code

type, public :: whitespace_options_t
    !! Modes of the whitespace rules. The defaults follow the most common style in practice where it is
    !! clear-cut, and keep the rest.
    integer :: assignment = WS_ADD     !! `=` outside brackets: assignments, initializations, `do i = 1, n`
    integer :: keyword_args = WS_REMOVE !! `=` inside brackets: `f(x=1)`, `intent=`, `len=*`
    integer :: pointer = WS_ADD        !! `=>`: pointer assignment, renames, `associate`
    integer :: declarations = WS_ADD   !! `::`
    integer :: relational = WS_KEEP    !! `== /= < <= > >=` and `.eq.` etc.
    integer :: logical = WS_KEEP       !! `.and. .or. .eqv. .neqv.`
    integer :: plus_minus = WS_KEEP    !! binary `+ -`
    integer :: mult_div = WS_KEEP      !! binary `* /`
    integer :: power = WS_REMOVE       !! `**`
    integer :: concat = WS_REMOVE      !! `//`
    integer :: comma = WS_KEEP         !! `,`: with `WS_ADD`, no blank before and at least one after
    integer :: slice_colon = WS_REMOVE !! `:` inside brackets: `a(1:n)`
    integer :: percent = WS_REMOVE     !! `%`
    integer :: control_paren = WS_ADD  !! between `if`, `while`, `select case`, `where`, ... and `(`, and
                                       !! between `)` and a final `then`
    integer :: conditional = WS_ADD    !! `?` and `:` of a conditional expression `(c ? a : b)` (F2023)
    integer :: defined_operators = WS_KEEP !! binary user-defined operators: `a .plus. b`
end type whitespace_options_t