> +2013-05-03  David Malcolm  <dmalc...@redhat.com>
> +
> +       * gengtype-state.c: (indent_amount): New variable,
> +       (had_recent_newline): likewise
> +       (write_new_line): New function
> +       (write_any_indent): likewise
> +       (write_open_paren): likewise
> +       (write_close_paren): likewise
> +       (write_state_fileloc): Use the new functions above to write
> +       indentation into the gtype.state output file to visually represent
> +       the hierarchical structure of the list structures
> +       (write_state_fields): ditto
> +       (write_state_a_string): ditto
> +       (write_state_string_option): ditto
> +       (write_state_type_option): ditto
> +       (write_state_nested_option): ditto
> +       (write_state_option): ditto
> +       (write_state_options): ditto
> +       (write_state_lang_bitmap): ditto
> +       (write_state_version): ditto
> +       (write_state_scalar_type): ditto
> +       (write_state_string_type): ditto
> +       (write_state_undefined_type): ditto
> +       (write_state_struct_union_type): ditto
> +       (write_state_user_struct_type): ditto
> +       (write_state_lang_struct_type): ditto
> +       (write_state_param_struct_type): ditto
> +       (write_state_pointer_type): ditto
> +       (write_state_array_type): ditto
> +       (write_state_gc_used): ditto
> +       (write_state_type): ditto
> +       (write_state_pair): ditto
> +       (write_state_typedefs): ditto
> +       (write_state_structures): ditto
> +       (write_state_param_structs): ditto
> +       (write_state_variables): ditto
> +       (write_state_variables): ditto
> +       (write_state_files_list): ditto
> +       (write_state_languages): ditto
> +

The patch is OK with some minor formatting errors fixed:

> @@ -714,14 +778,15 @@ write_state_options (options_p opt)
>
>    if (opt == NULL)
>      {
> -      fprintf (state_file, "nil ");
> +       write_any_indent (0);
> +       fprintf (state_file, "nil ");
>        return;
>      }

Indentation error

> @@ -729,16 +794,17 @@ write_state_options (options_p opt)
>  static void
>  write_state_lang_bitmap (lang_bitmap bitmap)
>  {
> -  fprintf (state_file, "%d ", (int) bitmap);
> +   write_any_indent (0);
> +   fprintf (state_file, "%d ", (int) bitmap);
>  }

Likewise

> @@ -889,7 +971,10 @@ write_state_param_struct_type (type_p current)
>        if (current->u.param_struct.param[i] != NULL)
>         write_state_type (current->u.param_struct.param[i]);
>        else
> +        {
> +       write_any_indent (0);
>         fprintf (state_file, "nil ");
> +        }
>      }
>    write_state_fileloc (&current->u.param_struct.line);
>  }

Likewise

> @@ -1155,17 +1260,19 @@ write_state_files_list (void)
>        cursrcrelpath = get_file_srcdir_relative_path (curfil);
>        if (cursrcrelpath)
>         {
> -         fprintf (state_file, "(!srcfile %d ", get_lang_bitmap (curfil));
> +         write_open_paren ("srcfile");
> +          fprintf (state_file, "%d ", get_lang_bitmap (curfil));
>           write_state_a_string (cursrcrelpath);
>         }
>        else

Likewise

--
Laurynas

Reply via email to