ffmt_source Module

A source text read for formatting: its tokens, its statements and which of them formatter directives protect. Every pass that works on the text (formatting, line splitting, relational spelling, use sorting) starts from one of these.


Uses

  • module~~ffmt_source~~UsesGraph module~ffmt_source ffmt_source module~ffmt_directives ffmt_directives module~ffmt_source->module~ffmt_directives module~ffmt_lexer ffmt_lexer module~ffmt_source->module~ffmt_lexer module~ffmt_statements ffmt_statements module~ffmt_source->module~ffmt_statements module~ffmt_tokens ffmt_tokens module~ffmt_source->module~ffmt_tokens module~ffmt_directives->module~ffmt_statements module~ffmt_directives->module~ffmt_tokens module~ffmt_lexer->module~ffmt_tokens module~ffmt_strings ffmt_strings module~ffmt_lexer->module~ffmt_strings module~ffmt_statements->module~ffmt_tokens module~ffmt_statements->module~ffmt_strings module~ffmt_tokens->module~ffmt_strings

Used by

  • module~~ffmt_source~~UsedByGraph module~ffmt_source ffmt_source module~ffmt_case ffmt_case module~ffmt_case->module~ffmt_source module~ffmt_format ffmt_format module~ffmt_format->module~ffmt_source module~ffmt_format->module~ffmt_case module~ffmt_layout ffmt_layout module~ffmt_format->module~ffmt_layout module~ffmt_linebreak ffmt_linebreak module~ffmt_format->module~ffmt_linebreak module~ffmt_relational ffmt_relational module~ffmt_format->module~ffmt_relational module~ffmt_structure ffmt_structure module~ffmt_format->module~ffmt_structure module~ffmt_use_sort ffmt_use_sort module~ffmt_format->module~ffmt_use_sort module~ffmt_whitespace ffmt_whitespace module~ffmt_format->module~ffmt_whitespace module~ffmt_layout->module~ffmt_source module~ffmt_layout->module~ffmt_case module~ffmt_layout->module~ffmt_structure module~ffmt_layout->module~ffmt_whitespace module~ffmt_linebreak->module~ffmt_source module~ffmt_relational->module~ffmt_source module~ffmt_structure->module~ffmt_source module~ffmt_use_sort->module~ffmt_source module~ffmt_whitespace->module~ffmt_source module~ffmt_cli ffmt_cli module~ffmt_cli->module~ffmt_format

Derived Types

type, public ::  source_t

A source text with its tokens and statements.

Components

Type Visibility Attributes Name Initial
logical, public, allocatable :: keep(:)

for each item: protected by a formatter directive, so it is written as it is

type(statement_list_t), public :: stmts

its statements and standalone lines (items)

character(len=:), public, allocatable :: text

the text

type(token_list_t), public :: tokens

its tokens


Functions

public function statement_views(s) result(views)

The view of each item of s (see set_views, which fills them in place, without a copy).

Arguments

Type IntentOptional Attributes Name
type(source_t), intent(in) :: s

the source

Return Value type(statement_view_t), allocatable, (:)


Subroutines

public subroutine parse_source(text, s)

Read text into s: tokenize it, group the tokens into items and find the protected ones.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: text

the source text

type(source_t), intent(out) :: s

the result

public subroutine set_views(s, views)

Make views the view of each item of s (see statement_view_t); empty for items that are not code.

Arguments

Type IntentOptional Attributes Name
type(source_t), intent(in) :: s

the source

type(statement_view_t), intent(out), allocatable :: views(:)

the views