Lawrence Mitchell [Mon, 18 Jul 2011 14:49:37 +0000 (15:49 +0100)]
New variable specifying what file extensions are Fortran 90 code
Rather than hardcoding the regexp for .F90, .f90 and .fpp, add a new
variable `f90-file-extensions', a list of possible extensions that
match Fortran 90 files. While we're at it, add a customisation group
to pull user options together.
Lawrence Mitchell [Mon, 18 Jul 2011 11:04:20 +0000 (12:04 +0100)]
Speed up f90-split-arglist
Previously we inserted the arglist into a temporary buffer and split
it there. Since we're just using that to loop over the characters in
the string one at a time, do it in place by looping across the
characters of the array. This latter method takes around 70% less
time than the former. Since we split arglists thousands of times when
parsing a source tree, this is a worthwhile optimisation.
Lawrence Mitchell [Fri, 15 Jul 2011 22:07:38 +0000 (23:07 +0100)]
Make dimension parsing more robust
Allow for whitespace in a "dimension(...)" declaration, and move the
parsing of TYPE :: foo(:) style dimension declarations into
f90-parse-single-type-declaration, rather than having it in
f90-make-type-struct. This way argument matching when looking for
tags works better.
Lawrence Mitchell [Tue, 12 Jul 2011 14:51:46 +0000 (15:51 +0100)]
Correctly determine dimension specification
Previously, if we had a dimension spec like dimension(:, max(1, 10))
we thought the variable had rank 3. Now we only count top-level
commas and correctly determine that it is rank 2.
Lawrence Mitchell [Tue, 12 Jul 2011 14:32:25 +0000 (15:32 +0100)]
Default to type-at-point in f90-show-type-definition
Rather than just providing a completion table, try and guess a default
by looking for a type declaration on the current line, or (if that
fails) deriving the type of the variable at point.
Lawrence Mitchell [Tue, 12 Jul 2011 12:10:13 +0000 (13:10 +0100)]
Speed up f90-clean-comments
Rather than moving through the buffer one character at a time, search
forward for a possible comment start (a ! character) and then use
parse-partial-sexp to decide if we're actually in a comment or not.
It turns out most of the time in parsing was actually cleaning
comments, so this makes the code run significantly faster overall.
Lawrence Mitchell [Tue, 12 Jul 2011 12:07:31 +0000 (13:07 +0100)]
Parse prefix arg through to find-tag from f90-find-tag-interface
If we're searching for a tag, rather than an interface we need to pass
the prefix arg through so that the find-tag invocation can jump to
subsequent definitions.
Lawrence Mitchell [Tue, 12 Jul 2011 12:06:24 +0000 (13:06 +0100)]
Require etags and cl at runtime
Since we create structs on the fly, we need cl at runtime, not just
compile time. We need etags because we push things on to
find-tag-marker-ring which is not autoloaded.
Lawrence Mitchell [Mon, 11 Jul 2011 15:51:16 +0000 (16:51 +0100)]
Fix bug in f90-populate-specialisers
If an interface had multiple "module procedure" lines, we would only
add the final line to the interface's specialisers. Fix this by
initialising the specialisers hash table outside the search loop.
Lawrence Mitchell [Mon, 11 Jul 2011 14:10:13 +0000 (15:10 +0100)]
Allow f90-find-tag-interface to complete tags names
When binding f90-find-tag-interface to M-. we want to be able to
complete tag names (for find-tag) as well as interface names. So
merge the tags completion table with the interface name completion
table.
Lawrence Mitchell [Mon, 11 Jul 2011 13:49:25 +0000 (14:49 +0100)]
Fix jumping to definitions if we jump past recorded location
In some cases, the cached location of a specialiser might be past the
definition, in this case we need to search backwards for the beginning
of the definition if we can't find it looking forwards.
Lawrence Mitchell [Mon, 11 Jul 2011 09:53:16 +0000 (10:53 +0100)]
Normalise type-parsing routines and make arglist matching work
We now correctly match types in parsed arglists even in the case of
slot accesses. Function calls and array accesses are still not
handled (we just pass UNION-TYPE through). But, we do get some more
specialisation. For example with some type definitions:
type foo
type(bar) :: slot
end type foo
type bar
real, dimension(:), pointer :: n=>null()
end type bar
Lawrence Mitchell [Sat, 9 Jul 2011 21:10:32 +0000 (22:10 +0100)]
Further work on type parsing
We're now able to correctly determine argument types that specify
slots of derived types. This allows us to be better at specifying
subsets of the available interfaces. Needs more work on the approx
arglist matching code to be really useful.