process_stdin Function

private function process_stdin(cli, cache) result(status)

Format standard input to standard output (or report it with --check / --diff), with the configuration of the current directory, and return the exit status.

Arguments

Type IntentOptional Attributes Name
type(cli_t), intent(in) :: cli

the parsed command line

type(config_cache_t), intent(inout) :: cache

configurations found so far

Return Value integer


Calls

proc~~process_stdin~~CallsGraph proc~process_stdin process_stdin proc~process_text process_text proc~process_stdin->proc~process_text proc~read_stdin read_stdin proc~process_stdin->proc~read_stdin proc~format_text format_text proc~process_text->proc~format_text proc~options_for options_for proc~process_text->proc~options_for proc~to_s to_s proc~process_text->proc~to_s proc~unified_diff unified_diff proc~process_text->proc~unified_diff proc~write_file write_file proc~process_text->proc~write_file proc~builder_append string_builder_t%builder_append proc~read_stdin->proc~builder_append proc~builder_get string_builder_t%builder_get proc~read_stdin->proc~builder_get proc~format_text->proc~to_s proc~convert_relational convert_relational proc~format_text->proc~convert_relational proc~format_pass format_pass proc~format_text->proc~format_pass proc~limit_diagnostics limit_diagnostics proc~format_text->proc~limit_diagnostics proc~long_code_lines long_code_lines proc~format_text->proc~long_code_lines proc~relayout relayout proc~format_text->proc~relayout proc~sort_use sort_use proc~format_text->proc~sort_use proc~split_long_lines split_long_lines proc~format_text->proc~split_long_lines proc~tokenize tokenize proc~format_text->proc~tokenize proc~too_long too_long proc~format_text->proc~too_long proc~absolute_path absolute_path proc~options_for->proc~absolute_path proc~apply_setting apply_setting proc~options_for->proc~apply_setting proc~config_for config_for proc~options_for->proc~config_for proc~unified_diff->proc~builder_append proc~unified_diff->proc~builder_get proc~lcs lcs proc~unified_diff->proc~lcs proc~line_ids line_ids proc~unified_diff->proc~line_ids proc~range_text range_text proc~unified_diff->proc~range_text proc~split_lines split_lines proc~unified_diff->proc~split_lines proc~current_directory current_directory proc~absolute_path->proc~current_directory proc~is_absolute is_absolute proc~absolute_path->proc~is_absolute proc~join_path join_path proc~absolute_path->proc~join_path proc~apply_setting->proc~to_s proc~ends_with ends_with proc~config_for->proc~ends_with proc~find_config find_config proc~config_for->proc~find_config proc~load_config load_config proc~config_for->proc~load_config proc~convert_relational->proc~builder_append proc~convert_relational->proc~builder_get proc~is_chevron is_chevron proc~convert_relational->proc~is_chevron proc~parse_source parse_source proc~convert_relational->proc~parse_source proc~token_lower token_lower proc~convert_relational->proc~token_lower proc~token_text token_text proc~convert_relational->proc~token_text proc~format_pass->proc~to_s proc~analyze_structure analyze_structure proc~format_pass->proc~analyze_structure proc~compute_case compute_case proc~format_pass->proc~compute_case proc~compute_gaps compute_gaps proc~format_pass->proc~compute_gaps proc~layout layout proc~format_pass->proc~layout proc~format_pass->proc~parse_source proc~set_views set_views proc~format_pass->proc~set_views proc~lcs->proc~lcs proc~lcs_lengths lcs_lengths proc~lcs->proc~lcs_lengths proc~limit_diagnostics->proc~to_s proc~longest_line longest_line proc~limit_diagnostics->proc~longest_line proc~limit_diagnostics->proc~parse_source proc~hash hash proc~line_ids->proc~hash proc~long_code_lines->proc~parse_source proc~utf8_width utf8_width proc~long_code_lines->proc~utf8_width proc~range_text->proc~to_s proc~relayout->proc~builder_append proc~relayout->proc~builder_get proc~relayout->proc~format_pass proc~sort_use->proc~builder_append proc~sort_use->proc~builder_get proc~is_use_statement is_use_statement proc~sort_use->proc~is_use_statement proc~module_key module_key proc~sort_use->proc~module_key proc~sort_use->proc~parse_source proc~set_view set_view proc~sort_use->proc~set_view proc~sort_only_list sort_only_list proc~sort_use->proc~sort_only_list proc~sorted_order sorted_order proc~sort_use->proc~sorted_order proc~whole_lines whole_lines proc~sort_use->proc~whole_lines proc~split_long_lines->proc~builder_append proc~split_long_lines->proc~builder_get proc~break_point break_point proc~split_long_lines->proc~break_point proc~builder_length string_builder_t%builder_length proc~split_long_lines->proc~builder_length proc~split_long_lines->proc~parse_source proc~stands_alone stands_alone proc~split_long_lines->proc~stands_alone proc~split_long_lines->proc~token_text proc~split_long_lines->proc~utf8_width proc~add add proc~tokenize->proc~add proc~comment_kind comment_kind proc~tokenize->proc~comment_kind proc~dotop_at dotop_at proc~tokenize->proc~dotop_at proc~dotop_end dotop_end proc~tokenize->proc~dotop_end proc~fypp_inline_end fypp_inline_end proc~tokenize->proc~fypp_inline_end proc~is_blank is_blank proc~tokenize->proc~is_blank proc~is_digit is_digit proc~tokenize->proc~is_digit proc~is_preproc_start is_preproc_start proc~tokenize->proc~is_preproc_start proc~is_quote is_quote proc~tokenize->proc~is_quote proc~lex_number lex_number proc~tokenize->proc~lex_number proc~line_end line_end proc~tokenize->proc~line_end proc~name_end name_end proc~tokenize->proc~name_end proc~operator_end operator_end proc~tokenize->proc~operator_end proc~peek peek proc~tokenize->proc~peek proc~preproc_end preproc_end proc~tokenize->proc~preproc_end proc~string_end string_end proc~tokenize->proc~string_end proc~longest_code longest_code proc~too_long->proc~longest_code proc~add->proc~is_blank proc~add->proc~peek proc~is_code_char is_code_char proc~add->proc~is_code_char proc~push~2 token_list_t%push proc~add->proc~push~2 proc~analyze_structure->proc~to_s proc~analyze_structure->proc~token_lower proc~classify_statement classify_statement proc~analyze_structure->proc~classify_statement proc~closes closes proc~analyze_structure->proc~closes proc~conditional_kind conditional_kind proc~analyze_structure->proc~conditional_kind proc~construct_label construct_label proc~analyze_structure->proc~construct_label proc~fypp_depths fypp_depths proc~analyze_structure->proc~fypp_depths proc~middle_fits middle_fits proc~analyze_structure->proc~middle_fits proc~stack_push scope_stack_t%stack_push proc~analyze_structure->proc~stack_push proc~stack_restore scope_stack_t%stack_restore proc~analyze_structure->proc~stack_restore proc~stack_snapshot scope_stack_t%stack_snapshot proc~analyze_structure->proc~stack_snapshot proc~break_point->proc~token_lower proc~break_point->proc~token_text proc~break_point->proc~utf8_width proc~priority priority proc~break_point->proc~priority proc~comment_kind->proc~peek proc~is_letter is_letter proc~comment_kind->proc~is_letter proc~lowercase lowercase proc~comment_kind->proc~lowercase proc~kind_part kind_part proc~compute_case->proc~kind_part proc~names_case names_case proc~compute_case->proc~names_case proc~statement_case statement_case proc~compute_case->proc~statement_case proc~comment_gaps comment_gaps proc~compute_gaps->proc~comment_gaps proc~statement_gaps statement_gaps proc~compute_gaps->proc~statement_gaps interface~c_getcwd c_getcwd proc~current_directory->interface~c_getcwd proc~dotop_at->proc~peek proc~dotop_at->proc~is_letter proc~dotop_end->proc~name_end proc~dotop_end->proc~peek proc~is_name_char is_name_char proc~dotop_end->proc~is_name_char proc~dotop_end->proc~lowercase proc~find_config->proc~join_path proc~find_config->proc~load_config proc~empty empty proc~find_config->proc~empty proc~parent_directory parent_directory proc~find_config->proc~parent_directory proc~fypp_inline_end->proc~peek proc~is_preproc_start->proc~peek proc~layout->proc~builder_get proc~emit_blank emit_blank proc~layout->proc~emit_blank proc~emit_comment_line emit_comment_line proc~layout->proc~emit_comment_line proc~emit_fypp_line emit_fypp_line proc~layout->proc~emit_fypp_line proc~emit_range emit_range proc~layout->proc~emit_range proc~emit_statement emit_statement proc~layout->proc~emit_statement proc~lex_number->proc~dotop_at proc~lex_number->proc~is_digit proc~lex_number->proc~name_end proc~lex_number->proc~peek proc~digits_end digits_end proc~lex_number->proc~digits_end proc~lex_number->proc~is_name_char proc~lower_char lower_char proc~lex_number->proc~lower_char proc~load_config->proc~to_s get get proc~load_config->get get_keys get_keys proc~load_config->get_keys get_type get_type proc~load_config->get_type get_value get_value proc~load_config->get_value proc~load_config->proc~empty toml_load toml_load proc~load_config->toml_load proc~view_word statement_view_t%view_word proc~module_key->proc~view_word proc~name_end->proc~peek proc~name_end->proc~is_name_char proc~parse_source->proc~tokenize proc~protected_items protected_items proc~parse_source->proc~protected_items proc~split_statements split_statements proc~parse_source->proc~split_statements proc~preproc_end->proc~line_end proc~preproc_end->proc~peek proc~last_nonblank last_nonblank proc~preproc_end->proc~last_nonblank proc~make_lowercase make_lowercase proc~set_view->proc~make_lowercase proc~set_views->proc~set_view proc~sort_only_list->proc~builder_append proc~sort_only_list->proc~builder_get proc~sort_only_list->proc~sorted_order proc~sort_only_list->proc~token_text proc~only_items only_items proc~sort_only_list->proc~only_items proc~sort_only_list->proc~view_word proc~string_end->proc~is_blank proc~string_end->proc~line_end proc~string_end->proc~peek proc~only_blanks_to_eol only_blanks_to_eol proc~string_end->proc~only_blanks_to_eol proc~token_lower->proc~make_lowercase proc~closed_construct closed_construct proc~classify_statement->proc~closed_construct proc~expand_keyword expand_keyword proc~classify_statement->proc~expand_keyword proc~read_label read_label proc~classify_statement->proc~read_label proc~set set proc~classify_statement->proc~set proc~view_closing statement_view_t%view_closing proc~classify_statement->proc~view_closing proc~view_kind_of statement_view_t%view_kind_of proc~classify_statement->proc~view_kind_of proc~comment_gaps->proc~utf8_width proc~digits_end->proc~is_digit proc~digits_end->proc~peek proc~emit_blank->proc~token_text proc~put put proc~emit_blank->proc~put proc~emit_comment_line->proc~token_text proc~emit_comment_line->proc~emit_range proc~comment_column comment_column proc~emit_comment_line->proc~comment_column proc~input_column input_column proc~emit_comment_line->proc~input_column proc~emit_comment_line->proc~put proc~trim_blanks trim_blanks proc~emit_comment_line->proc~trim_blanks proc~emit_fypp_line->proc~emit_range proc~first_non_blank first_non_blank proc~emit_fypp_line->proc~first_non_blank proc~emit_fypp_line->proc~put proc~emit_range->proc~token_text proc~emit_range->proc~put proc~emit_statement->proc~token_lower proc~emit_statement->proc~token_text proc~emit_statement->proc~emit_range proc~emit_statement->proc~comment_column proc~continuation_target continuation_target proc~emit_statement->proc~continuation_target proc~emit_body emit_body proc~emit_statement->proc~emit_body proc~emit_continuation emit_continuation proc~emit_statement->proc~emit_continuation proc~emit_statement->proc~first_non_blank proc~fitting_column fitting_column proc~emit_statement->proc~fitting_column proc~emit_statement->proc~input_column proc~emit_statement->proc~put proc~fypp_depths->proc~token_lower proc~fypp_kind fypp_kind proc~fypp_depths->proc~fypp_kind proc~is_code_char->proc~is_blank proc~is_name_char->proc~is_digit proc~is_name_char->proc~is_letter proc~last_nonblank->proc~is_blank proc~lowercase->proc~lower_char proc~names_case->proc~view_word proc~names_case->proc~view_kind_of proc~only_blanks_to_eol->proc~line_end proc~only_blanks_to_eol->proc~last_nonblank proc~directive directive proc~protected_items->proc~directive proc~ends_with_continuation ends_with_continuation proc~split_statements->proc~ends_with_continuation proc~find_semicolon find_semicolon proc~split_statements->proc~find_semicolon proc~line_end_token line_end_token proc~split_statements->proc~line_end_token proc~line_kind line_kind proc~split_statements->proc~line_kind proc~push statement_list_t%push proc~split_statements->proc~push proc~stack_restore->proc~stack_push proc~statement_case->proc~view_word proc~statement_case->proc~view_closing proc~statement_case->proc~view_kind_of proc~statement_gaps->proc~is_chevron proc~statement_gaps->proc~view_word proc~is_word is_word proc~statement_gaps->proc~is_word proc~statement_gaps->proc~view_kind_of proc~comment_column->proc~fitting_column proc~comment_column->proc~input_column proc~directive->proc~token_text proc~emit_body->proc~token_lower proc~emit_body->proc~kind_part proc~emit_body->proc~input_column proc~emit_body->proc~put proc~line_pieces line_pieces proc~emit_body->proc~line_pieces proc~to_case to_case proc~emit_body->proc~to_case proc~emit_continuation->proc~emit_body proc~emit_continuation->proc~first_non_blank proc~emit_continuation->proc~fitting_column proc~emit_continuation->proc~input_column proc~emit_continuation->proc~put proc~first_piece_width first_piece_width proc~fitting_column->proc~first_piece_width proc~line_width line_width proc~fitting_column->proc~line_width proc~input_column->proc~utf8_width proc~put->proc~builder_append proc~put->proc~utf8_width proc~first_piece_width->proc~utf8_width proc~first_piece_width->proc~line_pieces proc~line_width->proc~utf8_width proc~line_width->proc~line_pieces

Called by

proc~~process_stdin~~CalledByGraph proc~process_stdin process_stdin proc~run run proc~run->proc~process_stdin

Source Code

integer function process_stdin(cli, cache) result(status)
    !! Format standard input to standard output (or report it with `--check` / `--diff`), with
    !! the configuration of the current directory, and return the exit status.
    type(cli_t), intent(in) :: cli                  !! the parsed command line
    type(config_cache_t), intent(inout) :: cache    !! configurations found so far
    character(len=:), allocatable :: text
    call read_stdin(text)
    status = process_text(cli, cache, '<stdin>', '.', text, .true.)
end function process_stdin