PROCEDURE declarations

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sun Aug 19 16:21:00 GMT 2007


Janus Weil wrote:
> Tobias S. told me that my indenting in gfc_match_procedure was
> "consistently non-gnuish", which I don't really understand. I thought
> I got the indenting right by now. Can you please clarify? Also I
> didn't quite get your comment about "missing vertical whitespace" in
> the resolve_symbol hunk ...

I'll answer this with a few specific remarks.

> +  /* Store the formal namespace information.  */
> +  if (dest->formal != NULL)
> +  /* The current ns should be that for the dest proc.  */
> +    dest->formal_ns = gfc_current_ns;

The comment should be indented to the same level as the code.

> +  if (gfc_match (" (") != MATCH_YES)
> +  {
> +    gfc_current_locus = entry_loc;
> +    return MATCH_NO;
> +  }

The braces need to be indented as well, i.e.
      if (gfc_match (" (" != MATCH_YES)
        {
          gfc_current_locus = endtry_loc;
          return MATCH_NO;
        }

If you're using emacs just hit TAB on every single line, and the 
indenting should be right.

The comment regarding vertical whitespace means that you should insert 
blank lines to structure the code visually.  This is a matter of taste 
much like commenting so I can't give you any strict guidelines. 
Basically, insert a blank line before something new happens.

Cheers,
- Tobi



More information about the Fortran mailing list