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.
A source text with its tokens and statements.
| 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 |
The view of each item of s (see set_views, which fills them in place, without a copy).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(source_t), | intent(in) | :: | s |
the source |
Read text into s: tokenize it, group the tokens into items and find the protected ones.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
the source text |
||
| type(source_t), | intent(out) | :: | s |
the result |
Make views the view of each item of s (see statement_view_t); empty for items that are
not code.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(source_t), | intent(in) | :: | s |
the source |
||
| type(statement_view_t), | intent(out), | allocatable | :: | views(:) |
the views |