ford icon indicating copy to clipboard operation
ford copied to clipboard

More informative error messages

Open cmacmackin opened this issue 10 years ago • 3 comments

As @zbeekman pointed out in #74, error messages are not very descriptive. It would be worthwhile to see if there is any way to provide more detailed messages. Failing that, I could write a page in the wiki describing what messages may mean.

cmacmackin avatar Sep 01 '15 14:09 cmacmackin

When it is time to deal with that, could it be possible to set the line number for undocumented variable(s) ?

jburgalat avatar Jan 13 '16 19:01 jburgalat

Ah. This had been a suggestion in the original feature request for the warnings. However, due to the way in which FORD processes files, this is nontrivial. The problem arises because the first step in analyzing the code is to rearrange the source by into a more standard format, eliminating white-space, merging continued lines, splitting lines along semicolons, removing any non-documentation comments, and reorganizing documentation comments so that they all look the same for later on. After all of this, information about line numbers from the original file is pretty much lost. I may give it a thing though, as there are various other useful things which knowing line numbers would allow.

On 16-01-13 07:07 PM, Jérémie Burgalat wrote:

When it is time to deal with that, could it be possible to set the line number for undocumented variable(s) ?

— Reply to this email directly or view it on GitHub https://github.com/cmacmackin/ford/issues/85#issuecomment-171400130.

Chris MacMackin cmacmackin.github.io http://cmacmackin.github.io

cmacmackin avatar Jan 13 '16 23:01 cmacmackin

Had the same issue: Ford flagging an error but I couldn't sort out why...

So one of the things I did was to hack sourceform.py:

    if vartype == "type" or vartype == "class" or vartype == "procedure":
        PROTO_RE = re.compile("(\*|\w+)\s*(?:\((.*)\))?")
        try:
            proto = list(PROTO_RE.match(args).groups())
            if not proto[1]: proto[1] = ''
        except:
            raise Exception("Bad type, class, or procedure prototype specification: {}".format(args))
        return (vartype, None, None, proto, rest)
    elif vartype == "character":
        if star:
            print('String fout {} '.format(string))
            return (vartype, None, args[1], None, rest)
        else:
            kind = None
            length = None

With a simple print statement.

And then I found out that FORD does not like a traditional:

character*1, dimension(N) :: Carray

Dohle avatar Oct 12 '16 08:10 Dohle